Package com.etsy.conjecture.model

Source Code of com.etsy.conjecture.model.ElasticNetOptimizer

package com.etsy.conjecture.model;

import com.etsy.conjecture.data.LazyVector;
import com.etsy.conjecture.data.Label;
import com.etsy.conjecture.data.LabeledInstance;
import java.util.Collection;
import com.etsy.conjecture.Utilities;
import com.etsy.conjecture.data.StringKeyedVector;

public class ElasticNetOptimizer extends SGDOptimizer implements LazyVector.UpdateFunction {

    @Override
    public StringKeyedVector getUpdate(LabeledInstance instance) {
        StringKeyedVector gradients = model.getGradients(instance);
        double learningRate = getDecreasingLearningRate(model.epoch);
        gradients.mul(-learningRate);
        return gradients;
    }

}
TOP

Related Classes of com.etsy.conjecture.model.ElasticNetOptimizer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.