Neural network in pytorch
I wanna create a Neural Network in PyTorch, that will have 2 inputs and 3 outputs with 1 hidden layer. The two inputs will be float numbers that represents features of an image and 3 outputs will be real numbers between 0 and 1. For example output (1, 0, 0) would mean that it is square and (0,1,0) would mean it is rectangle. Any idea how to do it in pytorch?

The network can be defined like this:

import torch
import torch.nn as nn
import torch.optim as optim
import torch.autograd as autograd 
import torch.nn.functional as F
from torch.autograd import Variable

class Net(nn.Module):
    def __init__(self, num_inputs=2, num_outputs=3,hidden_dim=5):
        # define your network here
        super(Net, self).__init__()
        self.layer1 = nn.Linear(num_inputs,hidden_dim)
        self.layer2 = nn.Linear(hidden_dim,num_outputs)


    def forward(self, x):
        # implement the forward pass
        x = F.relu(self.layer1(x))
        x = F.sigmoid(self.layer2(x))
        return x



Although I have defined the network here, you should maybe look at some examples on the official pytorch website for example on how to train your model.
