How to initialise weights for the first layer

 # layers
  self.hidden_layer_1 = torch.nn.Linear(80,100)
  self.hidden_layer_2 = torch.nn.Linear(100,100)
  self.output = torch.nn.Linear(100,15)
 def forward(self, input):
        H1 = self.hidden_layer_1(input)
        H1 = self.ReLU(H1)
        H2 = self.hidden_layer_2(H1)
        H2 = self.ReLU(H2)
        final_inputs = self.output(H2)
        # not applying activation on final_inputs because CrossEntropyLoss does that
        return final_inputs

I have a feed forward neural network with 80 input features, two hidden layers with 100 nodes each and 15 outputs(one for each class).

I save weights from a restricted boltzmann machine on tensor flow in a .pkl file.

How do I initialise the above code with these weights?

Assuming you’ve stored the TF weights as numpy arrays, you could take a look at this notebook, which @tom and I created to port the StyleGAN parameters to our PyTorch implementation.