feed-forward neural networks op self out(opy self final(opreturn the torch nn module provides the essential means to define and train neural networks it contains all the necessary building blocks for creating neural networks of various kindssizesand complexity we will create class for our neural network by inheriting this module and create an initializing method as well as forward pass method the __init__ method creates the different pieces of the network and keeps it ready for us every time we create an object with this class essentiallywe used the initialization method to create the hidden layersthe output layerand the activation for each layer the nn linear( , function creates layer with input features and output features the next layernaturallywill have input featuresand so on the nn relu(and nn sigmoid(functions add the activation function when connected to layer each of the individual components created within the initialization function is connected in the forward(method in the forward methodwe connect the individual components of the neural network the first hidden layerfc accepts input data and produces outputs for the next layer the fc layer is passed to the relu activation layerwhich then passes the activated output to the next layerfc which repeats the same processto create the final output layerwhich has the sigmoid activation function (since our toy dataset is crafted for binary classificationon creating an object of the class neuralnetworkand calling the forward methodwe get outputs from the networkwhich are computed by multiplying the input matrix with randomly initialized weight matrix passed through an activation function and repeated for the number of hidden layers until the final output layer at firstthe network would obviously generate junk outputs-- predictions (which would add no value to our classification problemat least not now