implement custom optimizer pytorch

Solutions on MaxInterview for implement custom optimizer pytorch by the best coders in the world

showing results for - "implement custom optimizer pytorch"
Valentín
08 May 2016
1optimizer = MySOTAOptimizer(my_model.parameters(), lr=0.001)
2for epoch in epochs:
3	for batch in epoch:
4		outputs = my_model(batch)
5		loss  = loss_fn(outputs, true_values)
6		loss.backward()
7		optimizer.step()
8