MCPcopy Create free account
hub / github.com/apache/madlib / run

Method run

src/modules/crf/linear_crf.cpp:850–867  ·  view source on GitHub ↗

* @brief Compute the log likelihood and gradient vector for each tuple */

Source from the content-addressed store, hash-verified

848 * @brief Compute the log likelihood and gradient vector for each tuple
849 */
850AnyType
851lincrf_lbfgs_step_transition::run(AnyType &args) {
852 LinCrfLBFGSTransitionState<MutableArrayHandle<double> > state = args[0];
853 MappedColumnVector sparse_r = args[1].getAs<MappedColumnVector>();
854 MappedColumnVector dense_m = args[2].getAs<MappedColumnVector>();
855 MappedColumnVector sparse_m = args[3].getAs<MappedColumnVector>();
856 if (state.numRows == 0) {
857 state.initialize(*this, static_cast<uint32_t>(args[4].getAs<double>()), static_cast<uint32_t>(args[5].getAs<double>()));
858 if (!args[6].isNull()) {
859 LinCrfLBFGSTransitionState<ArrayHandle<double> > previousState = args[6];
860 state = previousState;
861 state.reset();
862 }
863 }
864 state.numRows++;
865 compute_logli_gradient(state, sparse_r, dense_m, sparse_m);
866 return state;
867}
868
869/**
870 * @brief Perform the perliminary aggregation function: Merge transition states

Callers

nothing calls this directly

Calls 9

compute_logli_gradientFunction · 0.85
NullFunction · 0.85
lbfgsMethod · 0.80
save_stateMethod · 0.80
stateToResultFunction · 0.70
initializeMethod · 0.45
isNullMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected