Ignite: [question] how to address the case where different models in a project output variable number of outputs

Created on 25 Apr 2018  路  3Comments  路  Source: pytorch/ignite

@alykhantejani @jasonkriss @vfdev-5
Hey, thanks for posting this great framework for training pytorch model.

If a project need to train two models but with variable number of outputs (like y_pred, other_output = model(x)), do I have to create two self-defined create_supervised_trainer? any suggestion for this case?

Have a good day.

Most helpful comment

@walkacross feel free to ask and take a look at not yet released documentation: concepts, quickstart and examples. Here I made some more examples.

And if you are OK with this issue, could you please close it and reopen if needed

All 3 comments

@walkacross actually create_supervised_trainer is a helper method to create a trainer, feel free to copy and edit it locally in your application to satisfy your needs.
If your model outputs like this y_pred, other_output = model(x) you can have two possibilities:

  • use create_supervised_trainer and adapt loss function to handle this particular output
  • use a custom trainer and filter out the output to feed in the appropriate y to the standard loss functions

HTH

@vfdev-5 get it and thanks for your kind reply.

@walkacross feel free to ask and take a look at not yet released documentation: concepts, quickstart and examples. Here I made some more examples.

And if you are OK with this issue, could you please close it and reopen if needed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alykhantejani picture alykhantejani  路  3Comments

samarth-robo picture samarth-robo  路  3Comments

andreydung picture andreydung  路  4Comments

CreateRandom picture CreateRandom  路  3Comments

Sudy picture Sudy  路  4Comments