Example #1
0
 const vector<int>* add_delay(const vector<int>& toCoords)
 {
     if (delay.empty())
     {
         return &toCoords;
     }
     range_plus(delayedCoords, toCoords, delay);
     if (this->from->outputActivations.in_range(delayedCoords))
     {
         return &delayedCoords;
     }
     return 0;
 }
Example #2
0
	virtual void feed_back(const vector<int>& outCoords)
	{
		const double* outIt = this->outputErrors[outCoords].begin();
		range_multiply(blockOffset, outCoords, blockShape);
		for (blockIterator.begin(); !blockIterator.end; ++blockIterator)
		{
			range_plus(inCoords, *blockIterator, blockOffset);
			double* inErr = this->source->outputErrors.at(inCoords).begin();
			if (inErr)
			{
				transform(outIt, outIt + sourceSize, inErr, inErr, plus<double>());
			}
			outIt += sourceSize;
		}
	}
Example #3
0
	virtual void feed_forward(const vector<int>& outCoords)
	{
		double* outIt = this->outputActivations[outCoords].begin();
		range_multiply(blockOffset, outCoords, blockShape);
		for (blockIterator.begin(); !blockIterator.end; ++blockIterator)
		{
			range_plus(inCoords, *blockIterator, blockOffset);
			View<double> inActs = this->source->outputActivations.at(inCoords);
			if (inActs.begin())
			{
				std::copy(inActs.begin(), inActs.end(), outIt);
			}
			else
			{
				std::fill(outIt, outIt + sourceSize, 0);
			}
			outIt += sourceSize;
		}
	}