Search code examples
pythonmachine-learningcntk

CNTK Learner and zipped arguments in python


I've been following the CNTK Tutorial CNTK 203: Reinforcement Learning Basics and encountered sending the arguments to the Learner in the Brain class in the following way:

 arguments = dict(zip(self.loss.arguments, [x,y]))
 updated, results =self.trainer.train_minibatch(arguments, outputs=[self.loss.output])

This is the first time this is done in the tutorials. Can anyone understand why the arguments are a dictionary of zip objects? What does zip do in this scenario?


Solution

  • zip is a builtin function in python that creates tuples out of its list arguments. See this for more details. The code in question just createes a dictionary mapping the input variables of the network to the values x and y.