Skip to content

Tag: neural-network

How to test a trained model saved in .pth.tar files?

I am working with CORnet-Z and I am building a separate test file. The model seems to be saved as .pth.tar files What would be the best approach to load this model and run evaluation and testing? Answer To test a model you need to load the state dictionary of your trained model and optimizer (if applicable). …

Forward Propagation for Neural Network

I am trying to create a forward-propagation function in Python 3.8.2. The inputs look like this: I am not using biases (not sure if they are that important and it makes my code very complicated) but I am using weights. The weights are stored in a list, Layer1W, I’m not sure how long to make it, but I th…

How do i embed nnv diagram in flask?

I want to embed a nnv render in flask but my code semms to not be rendering the neural-network diagram. My code: Answer The problem is that matplotlib is used to plot the neural network graph; in order to return an image as an HTTP response, you need to convert the plot to bytes.