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_function
isupdate
ortrain_step
as per your question which will do forward pass + calc loss + gradient update.self
itself is theEngine
, so we use any class attribute, methods, etc ofEngine
whenever we need. So to answer your question, it's used internally.trainer
andengine
are arguments, it's ok if they are not defined before.process_function
only needs two arguments as per docs.