What is the first argument in step() function? #1547
-
|
I am new to ignite, I found several examples. We can see the first argument in train_step() function is In this example, the first argument of update() function is I want to know:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hi @Ordgod , you can provide the first argument with whatever name you want. The first argument is used here. ignite/ignite/engine/engine.py Line 852 in 5ceacbb
https://pytorch.org/ignite/master/engine.html#ignite.engine.engine.Engine |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Ordgod et very pleased to welcome you !! As you can see, HTH |
Beta Was this translation helpful? Give feedback.
Hi @Ordgod , you can provide the first argument with whatever name you want. The first argument is used here.
ignite/ignite/engine/engine.py
Line 852 in 5ceacbb
self._process_functionisupdateortrain_stepas per your question which will do forward pass + calc loss + gradient update.selfitself is theEngine, so we use any class attribute, methods, etc ofEnginewhenever we need. So to answer your question, it's used internally.trainerandengineare arguments, it's ok if they are not defined before.process_functiononly needs two arguments as per docs.