Skip to content

Reducing Parameters of Mask GCNN

Created by: chrisrothUT

This PR does two things.

  1. Allows masks to be passed through the GCNN constructor
  2. Reduces the parameters in the module to include only the "unmasked" parameters. This is useful for QGTJacobianPyTree, where you need n_parameters*n_samples to fit into memory

Here's an example of a GCNN with 2nd nearest neighbor convolutions on the square lattice:

#3 x 3 convolutional filter
input_mask = np.zeros([3,3])
for i in range(-1,2):
  for j in range(-1,2):
    input_mask[i][j] = 1
input_mask = input_mask.ravel()

# repeat mask over point group for hidden mask
hidden_mask = np.repeat(np.expand_dims(input_mask,1),repeats=8,axis=1).ravel()

g = nk.graph.Square(8)
ma = GCNN(symmetries=g,parity=1,input_mask=input_mask,hidden_mask=hidden_mask...)

I'd like to make this a bit more user friendly if possible

Merge request reports