archinetai / audio-diffusion-pytorch

Audio generation using diffusion models, in PyTorch.
MIT License
1.95k stars 169 forks source link

Am I training the model correctly? #33

Closed cat-policlot closed 1 year ago

cat-policlot commented 1 year ago

hello, I am new to neural network models, I would like to ask if I am training the model correctly? here is the part of the code

model = AudioDiffusionModel(in_channels=1).to("cuda")
optimizer = Adam(model.parameters(),lr=0.0001)

for i in range(epochs):
  for x in iter(Data):
    loss = model(x)
    loss.backward()
    optimizer.step()
    optimizer.zero_grad()
    loss_history.append(loss)
flavioschneider commented 1 year ago

Yes.

datacurse commented 1 year ago

Did you manage to work it out? I've also wanted to train the model, but can't find any guides