src/modules/convex/mlp_igd.cpp
/**
 * @brief Perform the multilayer perceptron final step
 */
@brief Perform the multilayer perceptron final step
@brief Perform the multilayer perceptron final step
AnyType
mlp_minibatch_final::run(AnyType &args) {
    MLPMiniBatchState<MutableArrayHandle<double> > state = args[0];
    if (state.algo.numRows == 0) { return Null(); }
    L2<MLPModelType>::lambda = state.task.lambda;
    state.algo.loss = state.algo.loss/static_cast<double>(state.algo.numRows);
    state.algo.loss += L2<MLPModelType>::loss(state.task.model);
    return state;
}
AnyType mlp_minibatch_final :: run ( AnyType & args ) { MLPMiniBatchState < MutableArrayHandle < double > > state = args [ 0 ] ; if ( state . algo . numRows == 0 ) { return Null ( ) ; } L2 < MLPModelType > :: lambda = state . task . lambda ; state . algo . loss = state . algo . loss / static_cast < double > ( state . algo . numRows ) ; state . algo . loss += L2 < MLPModelType > :: loss ( state . task . model ) ; return state ; }
@brief Perform the multilayer perceptron final step
@brief Perform the multilayer perceptron final step
// We request a mutable object. Depending on the backend, this might perform // a deep copy. // Aggregates that haven't seen any data just return Null.