home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (ParameterAveragingTrainingResult.java)

This example Java source code file (ParameterAveragingTrainingResult.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

computationgraphupdater, data, indarray, override, parameteraveragingtrainingresult, sparktrainingstats, updater

The ParameterAveragingTrainingResult.java Java example source code

package org.deeplearning4j.spark.impl.paramavg;

import lombok.Data;
import org.deeplearning4j.nn.api.Updater;
import org.deeplearning4j.nn.updater.graph.ComputationGraphUpdater;
import org.deeplearning4j.spark.api.TrainingResult;
import org.deeplearning4j.spark.api.stats.SparkTrainingStats;
import org.nd4j.linalg.api.ndarray.INDArray;

/**
 * The results (parameters, optional updaters) returned by a {@link ParameterAveragingTrainingWorker} to the
 * {@link ParameterAveragingTrainingMaster}
 *
 * @author Alex Black
 */
@Data
public class ParameterAveragingTrainingResult implements TrainingResult {

    private final INDArray parameters;
    private final Updater updater;
    private final ComputationGraphUpdater graphUpdater;
    private final double score;
    private SparkTrainingStats sparkTrainingStats;

    public ParameterAveragingTrainingResult(INDArray parameters, Updater updater, double score) {
        this(parameters, updater, score, null);
    }

    public ParameterAveragingTrainingResult(INDArray parameters, ComputationGraphUpdater updater, double score) {
        this(parameters, null, updater, score, null);
    }

    public ParameterAveragingTrainingResult(INDArray parameters, Updater updater, double score, SparkTrainingStats sparkTrainingStats) {
        this(parameters, updater, null, score, sparkTrainingStats);
    }

    public ParameterAveragingTrainingResult(INDArray parameters, ComputationGraphUpdater updater, double score, SparkTrainingStats sparkTrainingStats) {
        this(parameters, null, updater, score, sparkTrainingStats);
    }

    public ParameterAveragingTrainingResult(INDArray parameters, Updater updater, ComputationGraphUpdater graphUpdater, double score,
                                            SparkTrainingStats sparkTrainingStats) {
        this.parameters = parameters;
        this.updater = updater;
        this.graphUpdater = graphUpdater;
        this.score = score;
        this.sparkTrainingStats = sparkTrainingStats;
    }

    @Override
    public void setStats(SparkTrainingStats sparkTrainingStats) {
        this.sparkTrainingStats = sparkTrainingStats;
    }
}

Other Java examples (source code examples)

Here is a short list of links related to this Java ParameterAveragingTrainingResult.java source code file:



my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.