miracleyoo / pytorch-lightning-template

An easy/swift-to-adapt PyTorch-Lighting template. 套壳模板,简单易用,稍改原来Pytorch代码,即可适配Lightning。You can translate your previous Pytorch code much easier using this template, and keep your freedom to edit all the functions as well. Big-project-friendly as well. No need to rewrite your config in hydra.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问LOSS是怎么反向传播的?

a897456 opened this issue · comments

loss是在training_step和validation_step产生,但是在main()中好像没有loss的字眼。请问是怎么back的?

lightning 需要在模型类中定义training_step函数,在training_step函数中进行反向传播,详见文档:https://lightning.ai/docs/pytorch/stable/model/train_model_basic.html