<s> __author__ = '<STR_LIT>' <EOL> from pybrain . structure . connections . connection import Connection <EOL> from pybrain . structure . parametercontainer import ParameterContainer <EOL> from scipy import average <EOL> class SubsamplingConnection ( Connection , ParameterContainer ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , inmod , outmod , name = None , <EOL> inSliceFrom = <NUM_LIT:0> , inSliceTo = None , outSliceFrom = <NUM_LIT:0> , outSliceTo = None ) : <EOL> if outSliceTo is None : <EOL> outSliceTo = outmod . indim <EOL> size = outSliceTo - outSliceFrom <EOL> Connection . __init__ ( self , inmod , outmod , name , <EOL> inSliceFrom , inSliceTo , outSliceFrom , outSliceTo ) <EOL> ParameterContainer . __init__ ( self , size ) <EOL> def _forwardImplementation ( self , inbuf , outbuf ) : <EOL> outbuf += average ( inbuf ) * self . params <EOL> def _backwardImplementation ( self , outerr , inerr , inbuf ) : <EOL> raise NotImplementedError ( ) </s>
