src/trainer.cpp
//Add delta of a row of local parameters to the parameter stored in the buffer and send it to multiverso
Add delta of a row of local parameters to the parameter stored in the buffer and send it to multiverso
Add delta of a row of local parameters to the parameter stored in the buffer and send it to multiverso
void Trainer<T>::AddParameterRowToMultiverso(T* ptr, int table_id, int row_id, int size, real momentum)
{
	multiverso::Row<T>& row = GetRow<T>(table_id, row_id);
	for (int i = 0; i < size; ++i)
	{
		T dest = ptr[i] * (1 - momentum) + row.At(i) * momentum;
		T delta = (dest - row.At(i)) / m_process_count;
		Add<T>(table_id, row_id, i, delta);
	}
}
void Trainer < T > :: AddParameterRowToMultiverso ( T * ptr , int table_id , int row_id , int size , real momentum ) { multiverso :: Row < T > & row = GetRow < T > ( table_id , row_id ) ; for ( int i = 0 ; i < size ; ++ i ) { T dest = ptr [ i ] * ( 1 - momentum ) + row . At ( i ) * momentum ; T delta = ( dest - row . At ( i ) ) / m_process_count ; Add < T > ( table_id , row_id , i , delta ) ; } }
Add delta of a row of local parameters to the parameter stored in the buffer and send it to multiverso
Add delta of a row of local parameters to the parameter stored in the buffer and send it to multiverso