提交 ef66b2f9 authored 作者: Joseph Turian's avatar Joseph Turian

Reorganized docs

上级 56718bc7
......@@ -6,9 +6,10 @@ Contents
========
.. toctree::
:maxdepth: 2
:maxdepth: 3
index
LICENSE
install
tutorials/index
advanced/index
......@@ -16,6 +17,6 @@ Contents
examples/index
glossary
links
LICENSE
internal/index
doc/index
.. _concepts:
================
Concepts
================
This page introduces some important terminology for describing how theano
works.
Lets start by looking at what happens in a simple theano program.
.. code-block:: python
x = tensor.matrix('x')
y = tensor.matrix('y')
z = x + y
f = theano.function(input=[x,y], output=z, mode='FAST_RUN')
print f(numpy.ones(2,3), numpy.ones(2,3))
The first three lines build a :term:`graph` whose nodes correspond to variables (``x,y,z``) and expressions (just the '+' here).
The variables in such a graph are :term:`Result` instances of some
:term:`Type`, and the expressions are :term:`Apply` instances of some
:term:`Op`.
The line ``f = theano.function([x,y], [z], mode='FAST_RUN')`` :term:`compiles
<Compilation>`.
the graph we built and returns a :term:`function` whose ``__call__`` method
takes as arguments the values to use for ``x`` and ``y``.
The :term:`mode` controls which :term:`transformations <Graph Transformation>` are applied to the graph as we compile it.
The line ``print f(numpy.ones(2,3), numpy.ones(2,3))`` creates two
matrices, and then uses f's ``__call__`` method to run the compiled
function on those inputs.
The compiled function is executed by a :term:`linker`, which was also specified by the :term:`mode` argument to ``function``.
The instance f's ``__call__`` method returns a value for ``z`` (given ``x,y``) which we print.
.. _extending:
================
Extending theano
================
When you're comfortable with the material in :ref:`concepts`, move on to:
* HowtoCreateType create a new data type,
* HowtoCreateOp create a new type of Op,
* HowtoAddTransformation add a transformation to an existing transformation mode,
* Create a new mode by HowtoCreateLinker creating a new linker, or HowtoCreateTransformationMode create a new transformation mode.
.. _graph:
================================================
Graph: interconnected Apply and Result instances
================================================
<MOVED TO advanced/graphstructures.txt>
.. _README: ../README.html
.. _Download: ../README.html#downloading-theano
.. _Documentation: index.html
.. _Wiki: http://pylearn.org/theano
.. _task list: http://lgcm.iro.umontreal.ca/theano/query?status=accepted&status=assigned&status=new&status=reopened&group=milestone&max=200&col=id&col=summary&col=status&col=owner&col=type&col=priority&col=component&col=time&report=9&order=priority
=====================================
Theano Project Documentation Overview
=====================================
=========================================================
Sandbox, this documentation may or may not be out-of-date
=========================================================
.. toctree::
:glob:
......
.. _dev_start_guide:
=====================
Developer Start Guide
=====================
......@@ -38,7 +41,7 @@ As a developer, you should clone this repository like this:
- `hg clone 'http://username:password@pylearn.org/hg/theano' theano`
Nighlty test
Nightly test
============
Their is nightly build done. The output is at: http://lgcm/nightly_build/do_nightly_build.txt
......
.. _extending:
================
Extending theano
================
How to Add Transformations
==========================
WRITEME
How to Create a Linker
======================
WRITEME
How to Create a Transformation Mode
===================================
WRITEME
.. _internal:
======================
Internal documentation
======================
Structure
=========
.. toctree::
:maxdepth: 2
dev_start_guide
extending
......@@ -6,14 +6,14 @@ Using Module
Now that we're familiar with the basics, we introduce Theano's more
advanced interface, Module. This interface allows you to define Theano
"objects" which can have many state variables and many methods sharing
these states. This is what you should use to define complex systems such
as a neural network.
these states. The Module system simplifies the way to define complex
systems such as a neural network.
Remake of the "state" example
=============================
Let's use Module to re-implement :ref:`this example
Let's use Module to re-implement :ref:`the example using state
<functionstateexample>`.
>>> m = Module()
......@@ -44,21 +44,21 @@ Here we instantiate an empty Module.
>>> m.state = Member(T.dscalar())
Then we declare a variable for use with our Module. That variable will
be a :ref:`member` of the module, which means that it will be
Then we declare a Result for use with our Module. That Result will
be a :ref:`member` of the Module, which means that it will be
accessible as a field of the object we will create later (for reading
and writing). It will also be accessible from any :ref:`method`
defined in our Module.
.. note::
There is no need to name the variable explicitly here. m.state will
There is no need to name the Result explicitly here. ``m.state`` will
be given the name 'state' automatically.
>>> m.inc = External(T.dscalar('inc'))
The inc variable doesn't need to be declared as a Member because it
The ``inc`` variable doesn't need to be declared as a Member because it
will only serve as an input to the method we will define. This is why
it is defined as an :ref:`external` variable. Do note that it is
inconsequential if you do declare it as a Member - it is unlikely
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论