{"_id":"5654da6cdd82540d00278ae4","user":"5503e897e508a017002013bd","project":"5503ea178c5e913700362c70","version":{"_id":"563fc7631594380d009c1a5c","project":"5503ea178c5e913700362c70","__v":2,"createdAt":"2015-11-08T22:06:27.279Z","releaseDate":"2015-11-08T22:06:27.278Z","categories":["563fc7641594380d009c1a5d","563fc7641594380d009c1a5e","563fc7641594380d009c1a5f","5654ff257b89070d00f96386"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.9","version":"0.0.9"},"__v":6,"category":{"_id":"5654ff257b89070d00f96386","version":"563fc7631594380d009c1a5c","pages":[],"__v":0,"project":"5503ea178c5e913700362c70","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-25T00:21:57.507Z","from_sync":false,"order":1,"slug":"core-concepts","title":"Core Concepts"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-24T21:45:16.546Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"The third component necessary for building a deep learning model. Models perform some computation given their input variables. Models have three necessary functions to operate at the basic level:\n\n* get_inputs(): returns the input or list of inputs to the model (theano variables or expressions).\n* get_outputs(): returns the output or list of outputs of the model computation (theano expression).\n* get_params(): returns the dictionary of {string_name: theano variable} representing the model's internal parameters.\n\nPlease see the [full documentation](http://opendeep.readthedocs.org/en/latest/opendeep.models.html#module-opendeep.models.model) for all the other methods possible in a Model class.\n\n## Connecting models together\nGenerally, you can connect Models in three ways:\n\n* inputs: use the inputs= parameter to set the input for the model's computation. Inputs must be a tuple (or list of tuples) that include the shape monad and the input expression. See [Variables](doc:basics-variables) to learn about the shape monad.\n* hiddens: use the hiddens= parameter to replace the hidden representation for the model (if applicable). This is most often used for generative models where the outputs come from a hidden representation.\n* params: use the params= parameter to replace some or all of the internal model parameters. The parameters will be replaced based on the string key from the input dictionary.\n\n## Containers\nWe have a basic [Prototype](http://opendeep.readthedocs.org/en/latest/opendeep.models.container.html#module-opendeep.models.container.prototype) container to let you easily hook up models sequentially (similar to Torch's Sequential construct). With a Prototype, you can `.add(model_class_type, **kwargs)` to instantiate a Model with the given class and automatically set its inputs to the previous model's outputs. All of the models are kept in the internal `models` attribute as a list. Please refer to the documentation linked above to learn more about the Prototype container.","excerpt":"","slug":"basics-model","type":"basic","title":"Model"}
The third component necessary for building a deep learning model. Models perform some computation given their input variables. Models have three necessary functions to operate at the basic level: * get_inputs(): returns the input or list of inputs to the model (theano variables or expressions). * get_outputs(): returns the output or list of outputs of the model computation (theano expression). * get_params(): returns the dictionary of {string_name: theano variable} representing the model's internal parameters. Please see the [full documentation](http://opendeep.readthedocs.org/en/latest/opendeep.models.html#module-opendeep.models.model) for all the other methods possible in a Model class. ## Connecting models together Generally, you can connect Models in three ways: * inputs: use the inputs= parameter to set the input for the model's computation. Inputs must be a tuple (or list of tuples) that include the shape monad and the input expression. See [Variables](doc:basics-variables) to learn about the shape monad. * hiddens: use the hiddens= parameter to replace the hidden representation for the model (if applicable). This is most often used for generative models where the outputs come from a hidden representation. * params: use the params= parameter to replace some or all of the internal model parameters. The parameters will be replaced based on the string key from the input dictionary. ## Containers We have a basic [Prototype](http://opendeep.readthedocs.org/en/latest/opendeep.models.container.html#module-opendeep.models.container.prototype) container to let you easily hook up models sequentially (similar to Torch's Sequential construct). With a Prototype, you can `.add(model_class_type, **kwargs)` to instantiate a Model with the given class and automatically set its inputs to the previous model's outputs. All of the models are kept in the internal `models` attribute as a list. Please refer to the documentation linked above to learn more about the Prototype container.