@PrajwalPrashanth I don´t understand how the fit function train our model.

In scikit-learn we use model.fit() and it does the trick but here IDK how this works.

In my assignment I used a cicle to test different configurations but I’m not pretty sure what version does the model takes as final.

1 Like

**Fit**

- Takes input data and corresponding labels (truth values from dataloader)
- Takes predictions by passing input data to the model
- Compare predictions with the labels (This is loss calculation)
- Calculate gradients
- Make weight updates based on the calculated gradients and learning rate.
- Reset gradients for next set of calculations

Repeat 1-6 based on no. of epochs.

This is the gist of Fit function, if you can elaborate your question and be more specific on your doubt, i can explain them in more detail.

Courtesy- @PrajwalPrashanth