-
❓ Questions and HelpI passed the tensors that define the optimization to initialize the Vectors and Variables. My question is that after I do so, should I still need to pass the Dictionary containing all inputs to run the forward loop of the optimization problem? Because it seems that as long as I initialize the Vectors and Variables with the tensors which should be in the Dictionary, the solution is the same |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Just initialize Variable |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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.