Answer the question
In order to leave comments, you need to log in
How to train a neural network model?
Hello.
Here I am writing a neural network with the PyTorch library.
I figured out how to create a model, and even how to pass a signal through layers :)
Here is the class code
class Net(nn.Module):
def __init__(self):
super(Net,self).__init__()
self.layers = nn.Sequential(
nn.Linear(in_features=1,out_features=10),
nn.ReLU(),
nn.Linear(in_features=10,out_features=5),
nn.ReLU(),
nn.Linear(in_features=5,out_features=1),
nn.ReLU()
)
def forward(self, x):
return self.layers(x)
Answer the question
In order to leave comments, you need to log in
Hey!
Here is a good example of how the neural network is trained:
https://pytorch.org/tutorials/beginner/blitz/cifar...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question