All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.deeplearning4j.ui.flow.beans.ModelState Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.deeplearning4j.ui.flow.beans;

import lombok.Data;

import java.io.Serializable;
import java.util.*;

/**
 * @author [email protected]
 */
@Data
public class ModelState implements Serializable {
    private float score = 0.0f;
    private String trainingTime;
    private List scores = new ArrayList<>();
    private float performanceBatches;
    private float performanceSamples;
    private long iterationTime;

    private Map parameters = new HashMap<>();
    private Map gradients = new HashMap<>();
    private List learningRates = new ArrayList<>();

    private Map layerParams = new LinkedHashMap<>();

    //private List performanceBatches = new ArrayList<>();
    //private List performanceSamples = new ArrayList<>();

    public ModelState() {

    }

    public void addScore(float score) {
        if (scores.size() > 1000)
            scores.remove(0);

        scores.add(score);
    }


    public void addPerformanceBatches(float perf) {
        performanceBatches = perf;
    }

    public void addPerformanceSamples(float perf) {
        performanceSamples = perf;
    }
    /*
    public void addPerformanceBatches(float perf) {
        if (performanceBatches.size() > 100)
            performanceBatches.remove(0);
    
        performanceBatches.add(perf);
    }
    
    public void addPerformanceSamples(float perf) {
        if (performanceSamples.size() > 100)
            performanceSamples.remove(0);
    
        performanceSamples.add(perf);
    }
    */
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy