Ejemplo n.º 1
0
 /**
  * Create the FullConnection object using the specified input layer, output
  * layer, optimizer and weight initialize rule.
  *
  * @param InputLayerType The input layer which is connected with the output
  * layer.
  * @param OutputLayerType The output layer which is connected with the input
  * layer.
  * @param OptimizerType The optimizer used to update the weight matrix.
  * @param WeightInitRule The weight initialize rule used to initialize the
  * weight matrix.
  */
 FullConnection(InputLayerType& inputLayer,
                OutputLayerType& outputLayer,
                OptimizerType& optimizer,
                WeightInitRule weightInitRule = WeightInitRule()) :
     inputLayer(inputLayer), outputLayer(outputLayer), optimizer(optimizer)
 {
   weightInitRule.Initialize(weights, outputLayer.InputSize(),
       inputLayer.OutputSize());
 }
Ejemplo n.º 2
0
 /**
  * Create the SelfConnection object using the specified input layer, output
  * layer, optimizer and weight initialize rule.
  *
  * @param InputLayerType The input layer which is connected with the output
  * layer.
  * @param OutputLayerType The output layer which is connected with the input
  * layer.
  * @param OptimizerType The optimizer used to update the weight matrix.
  * @param WeightInitRule The weight initialize rule used to initialize the
  * weight matrix.
  */
 SelfConnection(InputLayerType& inputLayer,
                OutputLayerType& outputLayer,
                OptimizerType& optimizer,
                WeightInitRule weightInitRule = WeightInitRule()) :
     inputLayer(inputLayer),
     outputLayer(outputLayer),
     optimizer(optimizer),
     connection(1 - arma::eye<MatType>(inputLayer.OutputSize(),
         inputLayer.OutputSize()))
 {
   weightInitRule.Initialize(weights, outputLayer.InputSize(),
       inputLayer.OutputSize());
 }
Ejemplo n.º 3
0
 /**
  * Create the SelfConnection object using the specified input layer, output
  * layer, optimizer and weight initialize rule.
  *
  * @param InputLayerType The input layer which is connected with the output
  * layer.
  * @param OutputLayerType The output layer which is connected with the input
  * layer.
  * @param OptimizerType The optimizer used to update the weight matrix.
  * @param WeightInitRule The weight initialize rule used to initialize the
  * weight matrix.
  */
 SelfConnection(InputLayerType& inputLayer,
                OutputLayerType& outputLayer,
                WeightInitRule weightInitRule = WeightInitRule()) :
     inputLayer(inputLayer),
     outputLayer(outputLayer),
     optimizer(new OptimizerType<SelfConnection<InputLayerType,
                                                OutputLayerType,
                                                OptimizerType,
                                                WeightInitRule,
                                                MatType,
                                                VecType>, MatType>(*this)),
     ownsOptimizer(true),
     connection(1 - arma::eye<MatType>(inputLayer.OutputSize(),
         inputLayer.OutputSize()))
 {
   weightInitRule.Initialize(weights, outputLayer.InputSize(),
       inputLayer.OutputSize());
 }