Skip to content

When should I pass a Dic of inputs for the forward loop? #472

Answered by luisenp
xphsean12 asked this question in Q&A
Discussion options

You must be logged in to vote

The dictionary is mostly useful if you have batches of data defining different optimization problems, so that you pass new values for everything with each incoming batch. If you are only running optimization on a single problem, and you initialize all values when you create the objects, then you don't need to pass the dictionary.

That being said, I personally prefer to initialize everything with the dictionary, because it's easier to see what's going on if all initialization happens in a single place in the code. But functionality-wise there is no difference.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mhmukadam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #466 on February 27, 2023 16:26.