### Navigation

- index
- modules |
- next |
- previous |
- PyBrain v0.3 documentation »

# `connections` – Structural Components: Connections

class `pybrain.structure.connections.connection.``Connection`(inmod, outmod, name=None, inSliceFrom=0, inSliceTo=None, outSliceFrom=0, outSliceTo=None)

  A connection links 2 modules, more precisely: the output of the first module to the input of the second. It can potentially transform the information on the way. It also transmits errors backwards between the same modules.

  `__init__`(inmod, outmod, name=None, inSliceFrom=0, inSliceTo=None, outSliceFrom=0, outSliceTo=None)

    Every connection requires an input and an output module. Optionally, it is possible to define slices on the buffers.

    Parameters: | inmod – input module outmod – output module
    Key inslicefrom:
    | starting index on the buffer of inmod (default = 0)
    Key insliceto: | ending index on the buffer of inmod (default = last)
    Key outslicefrom:
    | starting index on the buffer of outmod (default = 0)
    Key outsliceto: | ending index on the buffer of outmod (default = last)

  `forward`(inmodOffset=0, outmodOffset=0)

    Propagate the information from the incoming module’s output buffer, adding it to the outgoing node’s input buffer, and possibly transforming it on the way.

    For this transformation use inmodOffset as an offset for the inmod and outmodOffset as an offset for the outmodules offset.

  `backward`(inmodOffset=0, outmodOffset=0)

    Propagate the error found at the outgoing module, adding it to the incoming module’s output-error buffer and doing the inverse transformation of forward propagation.

    For this transformation use inmodOffset as an offset for the inmod and outmodOffset as an offset for the outmodules offset.

    If appropriate, also compute the parameter derivatives.

class `pybrain.structure.connections.``FullConnection`(*args, **kwargs)

  Bases: `pybrain.structure.connections.connection.Connection`, `pybrain.structure.parametercontainer.ParameterContainer`

  Connection which fully connects every element from the first module’s output buffer to the second module’s input buffer in a matrix multiplicative manner.

  `whichBuffers`(paramIndex)
    Return the index of the input module’s output buffer and the output module’s input buffer for the given weight.

class `pybrain.structure.connections.``IdentityConnection`(*args, **kwargs)

  Bases: `pybrain.structure.connections.connection.Connection`

  Connection which connects the i’th element from the first module’s output buffer to the i’th element of the second module’s input buffer.

class `pybrain.structure.connections.``MotherConnection`(nbparams, **args)

  Bases: `pybrain.structure.parametercontainer.ParameterContainer`

  The container for the shared parameters of connections (just a container with a constructor, actually).

class `pybrain.structure.connections.``SharedConnection`(mother, *args, **kwargs)

  Bases: `pybrain.structure.connections.connection.Connection`

  A shared connection can link different couples of modules, with a single set of parameters (encapsulated in a MotherConnection).

  `mother`
    pointer to MotherConnection

class `pybrain.structure.connections.``SharedFullConnection`(mother, *args, **kwargs)

  Bases: `pybrain.structure.connections.shared.SharedConnection`, `pybrain.structure.connections.full.FullConnection`

  Shared version of FullConnection.

### Navigation

- index
- modules |
- next |
- previous |
- PyBrain v0.3 documentation »