madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iyerr3 <...@git.apache.org>
Subject [GitHub] incubator-madlib pull request: Feature/svm grouping
Date Thu, 05 Nov 2015 21:31:09 GMT
Github user iyerr3 commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/1#discussion_r44072022
  
    --- Diff: src/modules/convex/linear_svm_igd.cpp ---
    @@ -95,19 +90,16 @@ linear_svm_igd_transition::run(AnyType &args) {
         using madlib::dbal::eigen_integration::MappedColumnVector;
         GLMTuple tuple;
         tuple.indVar.rebind(args[1].getAs<MappedColumnVector>().memoryHandle(),
    -            state.task.dimension);
    -    tuple.depVar = args[2].getAs<bool>() ? 1. : -1.;
    +                        state.task.dimension);
    +    tuple.depVar = args[2].getAs<double>();
     
         // Now do the transition step
         // apply IGD with regularization
    -    if (isL2) {
    -        L2<GLMModel>::scaling(state.algo.incrModel, lambda, nTuples, state.task.stepsize);
    -        LinearSVMIGDAlgorithm::transition(state, tuple);
    -    } else {
    -        LinearSVMIGDAlgorithm::transition(state, tuple);
    -        L1<GLMModel>::clipping(state.algo.incrModel, lambda, nTuples, state.task.stepsize);
    -    }
    -    // objective function and its gradient
    +    L2<GLMModel>::scaling(state.task.model, state.algo.incrModel, state.task.stepsize);
    --- End diff --
    
    Why not check the isL2 variable and only perform the necessary computation? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message