hello all i am a beginner in deep learning and pytorch. I have made sequential model in pytorch like code below.
input shape : (1934,1024)
expected output shape : (1934,8)
batch size = 32
when i train my model and check the output the size turn out to be (14,8). How i can have my output size as my expected size
class MLP(nn.Module):
def __init__(self):
super(MLP, self).__init__()
self.layers = nn.Sequential(
nn.Linear(1024, 100),
nn.Sigmoid(),
nn.Linear(100, 8),
#tempsigmoid()
TempSigmoid()
)
def forward(self, x):
x = self.layers(x)
return x
this is how i train my model
# Model TRAINING
epochs = 5
train_losses=[]
elapsed=[]
for epochs in range(epochs):
t0 = time.time()
model.train()
for batch_idx, (x,y) in enumerate(loader):
x,y = x.to(device), y.to(device)
optimizer.zero_grad()
outputs = model(x)
loss = loss_fn(outputs,y)
loss.backward()
optimizer.step()
StopatLossValue()
# program timing
torch.cuda.synchronize() #the right way to measure time in pytorch
t1 = time.time()
eta = t1-t0
if batch_idx % 100 == 0:
print('Train Epoch: {} \t Loss: {:.6f} \t Elapsed time :{:.2f} ms'.format(epochs, loss.item(), (eta*1000)))
elapsed.append(float(eta))
np.savetxt("eta.csv", elapsed, delimiter=",")