From b8a21bc99173921141fde18cac6aa87e55033005 Mon Sep 17 00:00:00 2001 From: brian Date: Fri, 7 Oct 2022 12:28:58 +0200 Subject: [PATCH] More test fixes Signed-off-by: brian --- .../ndarray/NDArrayColumnsMathOpTransform.java | 2 ++ .../ndarray/NDArrayMathFunctionTransform.java | 2 ++ .../ndarray/NDArrayScalarOpTransform.java | 2 ++ .../StringListToIndicesNDArrayTransform.java | 2 ++ .../image/transform/LargestBlobCropTransform.java | 2 ++ .../image/transform/PipelineImageTransform.java | 2 ++ .../image/transform/RandomCropTransform.java | 2 ++ .../autodiff/functions/DifferentialFunction.java | 5 +---- .../org/nd4j/autodiff/samediff/SDVariable.java | 14 ++------------ .../nd4j/autodiff/samediff/internal/Variable.java | 1 + .../java/org/nd4j/autodiff/util/SameDiffUtils.java | 2 +- .../classification/EvaluationCalibration.java | 2 +- .../java/org/nd4j/evaluation/curves/Histogram.java | 2 ++ .../deallocation/DeallocatableReference.java | 3 +++ .../nd4j/linalg/api/ops/BaseIndexAccumulation.java | 2 ++ .../org/nd4j/linalg/api/ops/DynamicCustomOp.java | 3 +++ .../org/nd4j/linalg/api/ops/custom/Flatten.java | 2 ++ .../ops/impl/controlflow/compat/BaseCompatOp.java | 3 +++ .../api/ops/impl/controlflow/compat/Enter.java | 2 ++ .../api/ops/impl/controlflow/compat/While.java | 2 ++ .../linalg/api/ops/impl/indexaccum/FirstIndex.java | 2 ++ .../linalg/api/ops/impl/indexaccum/LastIndex.java | 2 ++ .../api/ops/impl/indexaccum/custom/ArgAmax.java | 2 ++ .../api/ops/impl/indexaccum/custom/ArgAmin.java | 2 ++ .../api/ops/impl/indexaccum/custom/ArgMax.java | 2 ++ .../api/ops/impl/indexaccum/custom/ArgMin.java | 2 ++ .../layers/convolution/config/Conv1DConfig.java | 7 +++---- .../layers/convolution/config/Conv2DConfig.java | 2 ++ .../layers/convolution/config/Conv3DConfig.java | 2 ++ .../layers/convolution/config/DeConv2DConfig.java | 2 ++ .../layers/convolution/config/DeConv3DConfig.java | 2 ++ .../config/LocalResponseNormalizationConfig.java | 2 ++ .../layers/convolution/config/Pooling2DConfig.java | 2 ++ .../layers/convolution/config/Pooling3DConfig.java | 2 ++ .../org/nd4j/linalg/api/ops/impl/reduce/Mmul.java | 2 +- .../nd4j/linalg/api/ops/impl/reduce/MmulBp.java | 2 +- .../api/ops/impl/reduce/custom/BatchMmul.java | 2 +- .../nd4j/linalg/dataset/BalanceMinibatches.java | 5 +++++ .../org/nd4j/linalg/learning/config/AdaMax.java | 6 ++++-- .../java/org/nd4j/linalg/profiler/OpProfiler.java | 14 -------------- .../cavis-dnn-data-datavec-iterators/build.gradle | 1 + .../nn/modelimport/keras/layers/TFOpLayerImpl.java | 2 ++ .../keras/layers/core/KerasMasking.java | 2 ++ .../modelimport/keras/layers/core/KerasMerge.java | 2 ++ .../deeplearning4j/clustering/vptree/VPTree.java | 4 +++- .../org/deeplearning4j/eval/curves/Histogram.java | 2 ++ .../paramavg/ParameterAveragingTrainingMaster.java | 3 ++- .../training/SharedTrainingMaster.java | 3 ++- .../client/ParameterServerClient.java | 8 ++++---- .../zoo/model/TextGenerationLSTM.java | 2 +- 50 files changed, 101 insertions(+), 49 deletions(-) diff --git a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayColumnsMathOpTransform.java b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayColumnsMathOpTransform.java index 8be648fa0..ddbf34503 100644 --- a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayColumnsMathOpTransform.java +++ b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayColumnsMathOpTransform.java @@ -21,6 +21,7 @@ package org.datavec.api.transform.ndarray; import lombok.Data; +import lombok.EqualsAndHashCode; import org.datavec.api.transform.ColumnType; import org.datavec.api.transform.MathOp; import org.datavec.api.transform.metadata.ColumnMetaData; @@ -36,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Arrays; @Data +@EqualsAndHashCode(callSuper = false) public class NDArrayColumnsMathOpTransform extends BaseColumnsMathOpTransform { public NDArrayColumnsMathOpTransform(@JsonProperty("newColumnName") String newColumnName, diff --git a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayMathFunctionTransform.java b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayMathFunctionTransform.java index ca5b7921c..74a91332c 100644 --- a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayMathFunctionTransform.java +++ b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayMathFunctionTransform.java @@ -21,6 +21,7 @@ package org.datavec.api.transform.ndarray; import lombok.Data; +import lombok.EqualsAndHashCode; import org.datavec.api.transform.MathFunction; import org.datavec.api.transform.metadata.ColumnMetaData; import org.datavec.api.transform.transform.BaseColumnTransform; @@ -32,6 +33,7 @@ import org.nd4j.linalg.ops.transforms.Transforms; import com.fasterxml.jackson.annotation.JsonProperty; @Data +@EqualsAndHashCode(callSuper = false) public class NDArrayMathFunctionTransform extends BaseColumnTransform { //Can't guarantee that the writable won't be re-used, for example in different Spark ops on the same RDD diff --git a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayScalarOpTransform.java b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayScalarOpTransform.java index 4f4dcc4c3..708625c8a 100644 --- a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayScalarOpTransform.java +++ b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/ndarray/NDArrayScalarOpTransform.java @@ -21,6 +21,7 @@ package org.datavec.api.transform.ndarray; import lombok.Data; +import lombok.EqualsAndHashCode; import org.datavec.api.transform.MathOp; import org.datavec.api.transform.metadata.ColumnMetaData; import org.datavec.api.transform.metadata.NDArrayMetaData; @@ -33,6 +34,7 @@ import org.nd4j.linalg.ops.transforms.Transforms; import com.fasterxml.jackson.annotation.JsonProperty; @Data +@EqualsAndHashCode(callSuper = false) public class NDArrayScalarOpTransform extends BaseColumnTransform { private final MathOp mathOp; diff --git a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/transform/string/StringListToIndicesNDArrayTransform.java b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/transform/string/StringListToIndicesNDArrayTransform.java index 19a03ce83..2d31b5c05 100644 --- a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/transform/string/StringListToIndicesNDArrayTransform.java +++ b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/transform/transform/string/StringListToIndicesNDArrayTransform.java @@ -21,6 +21,7 @@ package org.datavec.api.transform.transform.string; import lombok.Data; +import lombok.EqualsAndHashCode; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.factory.Nd4j; import com.fasterxml.jackson.annotation.JsonProperty; @@ -31,6 +32,7 @@ import java.util.Collections; import java.util.List; @Data +@EqualsAndHashCode(callSuper = false) public class StringListToIndicesNDArrayTransform extends StringListToCountsNDArrayTransform { /** * @param columnName The name of the column to convert diff --git a/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/LargestBlobCropTransform.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/LargestBlobCropTransform.java index 0a12ee7f7..d823e5736 100644 --- a/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/LargestBlobCropTransform.java +++ b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/LargestBlobCropTransform.java @@ -21,6 +21,7 @@ package org.datavec.image.transform; import lombok.Data; +import lombok.EqualsAndHashCode; import org.bytedeco.javacv.OpenCVFrameConverter; import org.datavec.image.data.ImageWritable; import org.nd4j.linalg.factory.Nd4j; @@ -32,6 +33,7 @@ import org.bytedeco.opencv.opencv_core.*; import static org.bytedeco.opencv.global.opencv_imgproc.*; @Data +@EqualsAndHashCode(callSuper = false) public class LargestBlobCropTransform extends BaseImageTransform { protected org.nd4j.linalg.api.rng.Random rng; diff --git a/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/PipelineImageTransform.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/PipelineImageTransform.java index 84c4191be..524cf0a13 100644 --- a/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/PipelineImageTransform.java +++ b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/PipelineImageTransform.java @@ -21,6 +21,7 @@ package org.datavec.image.transform; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NonNull; import org.datavec.image.data.ImageWritable; @@ -32,6 +33,7 @@ import java.util.*; import org.bytedeco.opencv.opencv_core.*; @Data +@EqualsAndHashCode(callSuper = false) public class PipelineImageTransform extends BaseImageTransform { protected List> imageTransforms; diff --git a/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/RandomCropTransform.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/RandomCropTransform.java index 8d76ecb2c..86013c239 100644 --- a/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/RandomCropTransform.java +++ b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-image/src/main/java/org/datavec/image/transform/RandomCropTransform.java @@ -21,6 +21,7 @@ package org.datavec.image.transform; import lombok.Data; +import lombok.EqualsAndHashCode; import org.bytedeco.javacv.OpenCVFrameConverter; import org.datavec.image.data.ImageWritable; import org.nd4j.linalg.factory.Nd4j; @@ -35,6 +36,7 @@ import org.bytedeco.opencv.opencv_core.*; @JsonIgnoreProperties({"rng", "converter"}) @JsonInclude(JsonInclude.Include.NON_NULL) @Data +@EqualsAndHashCode(callSuper = false) public class RandomCropTransform extends BaseImageTransform { protected int outputHeight; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java index 3ab872d91..c7920422f 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java @@ -20,11 +20,8 @@ package org.nd4j.autodiff.functions; -import lombok.Data; -import lombok.Getter; -import lombok.Setter; +import lombok.*; import lombok.extern.slf4j.Slf4j; -import lombok.val; import onnx.Onnx; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java index bfbd49ff0..609a1ceba 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java @@ -46,7 +46,9 @@ public class SDVariable implements Serializable { protected SameDiff sameDiff; @Getter + @Setter protected String varName; + @Getter @Setter protected VariableType variableType; @@ -83,18 +85,6 @@ public class SDVariable implements Serializable { return varName; } - public void setVarName(String varName) { - this.varName = varName; - } - - /** - * @deprecated Use {@link #name()} - */ - @Deprecated - public String getVarName(){ - return name(); - } - /** * Returns true if this variable is a place holder * @return diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/internal/Variable.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/internal/Variable.java index 9f0bb48f8..dbc36b239 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/internal/Variable.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/samediff/internal/Variable.java @@ -39,5 +39,6 @@ public class Variable { protected String outputOfOp; //Null for placeholders/constants. For array type SDVariables, the name of the op it's an output of protected List controlDeps; //Control dependencies: name of ops that must be available before this variable is considered available for execution protected SDVariable gradient; //Variable corresponding to the gradient of this variable + @Builder.Default protected int variableIndex = -1; } diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/util/SameDiffUtils.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/util/SameDiffUtils.java index 560717ad8..a5e3f9b66 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/util/SameDiffUtils.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/autodiff/util/SameDiffUtils.java @@ -76,7 +76,7 @@ public class SameDiffUtils { public static ExternalErrorsFunction externalErrors(SameDiff sameDiff, Map externalGradients, SDVariable... inputs) { Preconditions.checkArgument(inputs != null && inputs.length > 0, "Require at least one SDVariable to" + - " be specified when using external errors: got %s", inputs); + " be specified when using external errors: got %s", (Object) inputs); ExternalErrorsFunction fn = new ExternalErrorsFunction(sameDiff, Arrays.asList(inputs), externalGradients); fn.outputVariable(); return fn; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java index e154fad61..670309928 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/classification/EvaluationCalibration.java @@ -49,7 +49,7 @@ import java.io.Serializable; import java.util.List; @Getter -@EqualsAndHashCode +@EqualsAndHashCode(callSuper = false) public class EvaluationCalibration extends BaseEvaluation { public static final int DEFAULT_RELIABILITY_DIAG_NUM_BINS = 10; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/curves/Histogram.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/curves/Histogram.java index afaf32b32..f3510d615 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/curves/Histogram.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/evaluation/curves/Histogram.java @@ -22,8 +22,10 @@ package org.nd4j.evaluation.curves; import lombok.Data; import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = false) public class Histogram extends BaseHistogram { private final String title; private final double lower; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/memory/deallocation/DeallocatableReference.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/memory/deallocation/DeallocatableReference.java index 24d0fe424..2c5cf41ac 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/memory/deallocation/DeallocatableReference.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/memory/deallocation/DeallocatableReference.java @@ -21,6 +21,8 @@ package org.nd4j.linalg.api.memory.deallocation; import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; import org.nd4j.linalg.api.memory.Deallocatable; import org.nd4j.linalg.api.memory.Deallocator; @@ -28,6 +30,7 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; @Data +@EqualsAndHashCode(callSuper = false) public class DeallocatableReference extends WeakReference { private String id; private Deallocator deallocator; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/BaseIndexAccumulation.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/BaseIndexAccumulation.java index 7ae3ade6c..bcaa443d9 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/BaseIndexAccumulation.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/BaseIndexAccumulation.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; @@ -36,6 +37,7 @@ import java.util.List; @Slf4j @Data +@EqualsAndHashCode(callSuper = false) public abstract class BaseIndexAccumulation extends BaseOp implements IndexAccumulation { protected boolean keepDims = false; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/DynamicCustomOp.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/DynamicCustomOp.java index 794b00eb0..36e6982a0 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/DynamicCustomOp.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/DynamicCustomOp.java @@ -44,6 +44,9 @@ import java.lang.reflect.Array; import java.util.*; @Slf4j +@Builder +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) public class DynamicCustomOp extends DifferentialFunction implements CustomOp { private String opName; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/custom/Flatten.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/custom/Flatten.java index 7c1fa9526..7981803e8 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/custom/Flatten.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/custom/Flatten.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.custom; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.val; import org.nd4j.autodiff.samediff.SDVariable; @@ -35,6 +36,7 @@ import java.util.List; @Data @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class Flatten extends DynamicCustomOp { private int order; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/BaseCompatOp.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/BaseCompatOp.java index b6664aeab..0e71c1db2 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/BaseCompatOp.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/BaseCompatOp.java @@ -21,6 +21,8 @@ package org.nd4j.linalg.api.ops.impl.controlflow.compat; import java.util.List; + +import lombok.EqualsAndHashCode; import lombok.NonNull; import lombok.val; import org.nd4j.autodiff.samediff.SDVariable; @@ -39,6 +41,7 @@ import org.tensorflow.framework.NodeDef; import java.util.HashMap; import java.util.Map; +@EqualsAndHashCode(callSuper = false) public abstract class BaseCompatOp extends DynamicCustomOp { protected String frameName; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/Enter.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/Enter.java index 2b24f6944..f88dd0f76 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/Enter.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/Enter.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.controlflow.compat; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; @@ -37,6 +38,7 @@ import java.util.Map; @Data @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class Enter extends BaseCompatOp { protected boolean isConstant; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/While.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/While.java index 518662ba8..b1f1b4b5c 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/While.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/controlflow/compat/While.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.controlflow.compat; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; @@ -36,6 +37,7 @@ import java.util.Map; @Data @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class While extends BaseCompatOp { protected boolean isConstant; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/FirstIndex.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/FirstIndex.java index 8c7b7739b..fe08a1299 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/FirstIndex.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/FirstIndex.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.indexaccum; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.NonNull; import org.nd4j.autodiff.samediff.SDVariable; @@ -36,6 +37,7 @@ import java.util.List; @Data @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class FirstIndex extends BaseIndexAccumulation { protected Condition condition; protected double compare; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/LastIndex.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/LastIndex.java index 7b0e47dce..305b859c7 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/LastIndex.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/LastIndex.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.indexaccum; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.NonNull; import org.nd4j.autodiff.samediff.SDVariable; @@ -38,6 +39,7 @@ import java.util.Map; @Data @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class LastIndex extends BaseIndexAccumulation { protected Condition condition; protected double compare; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmax.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmax.java index 228996407..84da21d67 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmax.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmax.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.indexaccum.custom; import lombok.Data; +import lombok.EqualsAndHashCode; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; import org.nd4j.common.base.Preconditions; @@ -38,6 +39,7 @@ import java.util.List; import java.util.Map; @Data +@EqualsAndHashCode(callSuper = false) public class ArgAmax extends DynamicCustomOp { protected boolean keepDims = false; private int[] dimensions; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmin.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmin.java index 16db04b2c..38562baee 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmin.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgAmin.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.indexaccum.custom; import lombok.Data; +import lombok.EqualsAndHashCode; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; import org.nd4j.common.base.Preconditions; @@ -38,6 +39,7 @@ import java.util.List; import java.util.Map; @Data +@EqualsAndHashCode(callSuper = false) public class ArgAmin extends DynamicCustomOp { protected boolean keepDims = false; private int[] dimensions; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMax.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMax.java index e2a7438bd..557b1f21f 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMax.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMax.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.indexaccum.custom; import lombok.Data; +import lombok.EqualsAndHashCode; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; import org.nd4j.common.base.Preconditions; @@ -37,6 +38,7 @@ import java.util.List; import java.util.Map; @Data +@EqualsAndHashCode(callSuper = false) public class ArgMax extends DynamicCustomOp { protected boolean keepDims = false; private int[] dimensions; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMin.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMin.java index 00445ee87..65d6ec1f3 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMin.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/indexaccum/custom/ArgMin.java @@ -21,6 +21,7 @@ package org.nd4j.linalg.api.ops.impl.indexaccum.custom; import lombok.Data; +import lombok.EqualsAndHashCode; import org.nd4j.autodiff.samediff.SDVariable; import org.nd4j.autodiff.samediff.SameDiff; import org.nd4j.common.base.Preconditions; @@ -37,6 +38,7 @@ import java.util.List; import java.util.Map; @Data +@EqualsAndHashCode(callSuper = false) public class ArgMin extends DynamicCustomOp { protected boolean keepDims = false; private int[] dimensions; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv1DConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv1DConfig.java index d86ed9f48..833aa5263 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv1DConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv1DConfig.java @@ -22,16 +22,15 @@ package org.nd4j.linalg.api.ops.impl.layers.convolution.config; import java.util.LinkedHashMap; import java.util.Map; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.NonNull; + +import lombok.*; import org.nd4j.common.base.Preconditions; import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class Conv1DConfig extends BaseConvolutionConfig { public static final String NCW = "NCW"; public static final String NWC = "NWC"; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv2DConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv2DConfig.java index 7981da12f..66e870027 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv2DConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv2DConfig.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.Map; import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.common.base.Preconditions; import org.nd4j.enums.WeightsFormat; @@ -32,6 +33,7 @@ import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class Conv2DConfig extends BaseConvolutionConfig { public static final String NCHW = "NCHW"; public static final String NHWC = "NHWC"; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv3DConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv3DConfig.java index 1607d6ccd..574868013 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv3DConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Conv3DConfig.java @@ -25,6 +25,7 @@ import java.util.LinkedHashMap; import java.util.Map; import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.common.base.Preconditions; import org.nd4j.linalg.util.ConvConfigUtil; @@ -32,6 +33,7 @@ import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class Conv3DConfig extends BaseConvolutionConfig { public static final String NDHWC = "NDHWC"; public static final String NCDHW = "NCDHW"; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv2DConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv2DConfig.java index 0b57e5cd5..bf9a041b9 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv2DConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv2DConfig.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.Map; import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.common.base.Preconditions; import org.nd4j.linalg.util.ConvConfigUtil; @@ -31,6 +32,7 @@ import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class DeConv2DConfig extends BaseConvolutionConfig { public static final String NCHW = "NCHW"; public static final String NHWC = "NHWC"; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv3DConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv3DConfig.java index 041cda3d2..6c793e7d0 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv3DConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/DeConv3DConfig.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.Map; import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.common.base.Preconditions; import org.nd4j.linalg.util.ConvConfigUtil; @@ -31,6 +32,7 @@ import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class DeConv3DConfig extends BaseConvolutionConfig { public static final String NCDHW = "NCDHW"; public static final String NDHWC = "NDHWC"; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/LocalResponseNormalizationConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/LocalResponseNormalizationConfig.java index e7edfcf4e..400ddd733 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/LocalResponseNormalizationConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/LocalResponseNormalizationConfig.java @@ -24,12 +24,14 @@ import java.util.LinkedHashMap; import java.util.Map; import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class LocalResponseNormalizationConfig extends BaseConvolutionConfig { private double alpha, beta, bias; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling2DConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling2DConfig.java index 1bf19aad2..bab13ae06 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling2DConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling2DConfig.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.Map; import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.linalg.api.ops.impl.layers.convolution.Pooling2D; import org.nd4j.linalg.api.ops.impl.layers.convolution.Pooling2D.Divisor; @@ -33,6 +34,7 @@ import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class Pooling2DConfig extends BaseConvolutionConfig { @Builder.Default private long kH = -1, kW = -1; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling3DConfig.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling3DConfig.java index 007c89e89..1ed04bcaf 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling3DConfig.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/layers/convolution/config/Pooling3DConfig.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.Map; import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.nd4j.linalg.api.ops.impl.layers.convolution.Pooling3D; import org.nd4j.linalg.api.ops.impl.layers.convolution.Pooling3D.Pooling3DType; @@ -32,6 +33,7 @@ import org.nd4j.linalg.util.ConvConfigUtil; @Data @Builder @NoArgsConstructor +@EqualsAndHashCode(callSuper = false) public class Pooling3DConfig extends BaseConvolutionConfig { @Builder.Default private long kD = -1, kW = -1, kH = -1; // kernel @Builder.Default private long sD = 1, sW = 1, sH = 1; // strides diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/Mmul.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/Mmul.java index b37be57c0..be291a9c3 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/Mmul.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/Mmul.java @@ -39,7 +39,7 @@ import org.tensorflow.framework.NodeDef; import java.lang.reflect.Field; import java.util.*; -@EqualsAndHashCode +@EqualsAndHashCode(callSuper = false) public class Mmul extends DynamicCustomOp { protected MMulTranspose mt; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/MmulBp.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/MmulBp.java index 58ed6f027..4471244ef 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/MmulBp.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/MmulBp.java @@ -32,7 +32,7 @@ import org.nd4j.common.util.ArrayUtil; import java.util.List; -@EqualsAndHashCode +@EqualsAndHashCode(callSuper = false) public class MmulBp extends DynamicCustomOp { protected MMulTranspose mt; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/custom/BatchMmul.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/custom/BatchMmul.java index ea312036d..a7d63e4bd 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/custom/BatchMmul.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/api/ops/impl/reduce/custom/BatchMmul.java @@ -32,7 +32,7 @@ import org.nd4j.linalg.factory.Nd4j; import java.util.*; -@EqualsAndHashCode +@EqualsAndHashCode(callSuper = false) public class BatchMmul extends DynamicCustomOp { protected int transposeA; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/dataset/BalanceMinibatches.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/dataset/BalanceMinibatches.java index 0e400c756..b77a29eb4 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/dataset/BalanceMinibatches.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/dataset/BalanceMinibatches.java @@ -39,10 +39,15 @@ import java.util.Map; public class BalanceMinibatches { private DataSetIterator dataSetIterator; private int numLabels; + @Builder.Default private Map> paths = Maps.newHashMap(); + @Builder.Default private int miniBatchSize = -1; + @Builder.Default private File rootDir = new File("minibatches"); + @Builder.Default private File rootSaveDir = new File("minibatchessave"); + @Builder.Default private List labelRootDirs = new ArrayList<>(); private DataNormalization dataNormalization; diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/learning/config/AdaMax.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/learning/config/AdaMax.java index 72785aba4..afb795a42 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/learning/config/AdaMax.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/learning/config/AdaMax.java @@ -20,7 +20,8 @@ package org.nd4j.linalg.learning.config; -import lombok.*; +import lombok.Builder; +import lombok.Data; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.learning.AdaMaxUpdater; import org.nd4j.linalg.learning.GradientUpdater; @@ -44,7 +45,8 @@ public class AdaMax implements IUpdater { public static final double DEFAULT_ADAMAX_BETA1_MEAN_DECAY = 0.9; public static final double DEFAULT_ADAMAX_BETA2_VAR_DECAY = 0.999; - @lombok.Builder.Default private double learningRate = DEFAULT_ADAMAX_LEARNING_RATE; // learning rate + @lombok.Builder.Default + private double learningRate = DEFAULT_ADAMAX_LEARNING_RATE; // learning rate private ISchedule learningRateSchedule; @lombok.Builder.Default private double beta1 = DEFAULT_ADAMAX_BETA1_MEAN_DECAY; // gradient moving avg decay rate @lombok.Builder.Default private double beta2 = DEFAULT_ADAMAX_BETA2_VAR_DECAY; // gradient sqrd decay rate diff --git a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/profiler/OpProfiler.java b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/profiler/OpProfiler.java index a62ccd21c..067b25370 100644 --- a/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/profiler/OpProfiler.java +++ b/cavis-dnn/cavis-dnn-api/src/main/java/org/nd4j/linalg/profiler/OpProfiler.java @@ -335,20 +335,6 @@ public class OpProfiler { } } - /** - * Dev-time method. - * - * @return - */ - protected StackAggregator getMixedOrderAggregator() { - // FIXME: remove this method, or make it protected - return mixedOrderAggregator; - } - - public StackAggregator getScalarAggregator() { - return scalarAggregator; - } - protected void updatePairs(String opName, String opClass) { // now we save pairs of ops/classes String cOpNameKey = prevOpName + " -> " + opName; diff --git a/cavis-dnn/cavis-dnn-data/cavis-dnn-data-datavec-iterators/build.gradle b/cavis-dnn/cavis-dnn-data/cavis-dnn-data-datavec-iterators/build.gradle index 32d9a5c2f..683436dab 100644 --- a/cavis-dnn/cavis-dnn-data/cavis-dnn-data-datavec-iterators/build.gradle +++ b/cavis-dnn/cavis-dnn-data/cavis-dnn-data-datavec-iterators/build.gradle @@ -25,4 +25,5 @@ dependencies { implementation "org.slf4j:slf4j-api" implementation "org.apache.commons:commons-lang3" + implementation "com.fasterxml.jackson.core:jackson-annotations" } \ No newline at end of file diff --git a/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/TFOpLayerImpl.java b/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/TFOpLayerImpl.java index 480cdf6d3..ab88f2aa5 100644 --- a/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/TFOpLayerImpl.java +++ b/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/TFOpLayerImpl.java @@ -21,6 +21,7 @@ package org.deeplearning4j.nn.modelimport.keras.layers; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ArrayUtils; import org.deeplearning4j.common.config.DL4JClassLoading; @@ -46,6 +47,7 @@ import java.util.List; @Slf4j @Data +@EqualsAndHashCode(callSuper = false) public class TFOpLayerImpl extends AbstractLayer { diff --git a/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMasking.java b/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMasking.java index 4e8fcb0f9..480267fb5 100644 --- a/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMasking.java +++ b/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMasking.java @@ -21,6 +21,7 @@ package org.deeplearning4j.nn.modelimport.keras.layers.core; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; import org.deeplearning4j.nn.conf.inputs.InputType; import org.deeplearning4j.nn.conf.layers.util.MaskZeroLayer; @@ -39,6 +40,7 @@ import java.util.Map; */ @Slf4j @Data +@EqualsAndHashCode(callSuper = false) public class KerasMasking extends KerasLayer { private double maskingValue; diff --git a/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMerge.java b/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMerge.java index 5c1a31ad0..332b74e73 100644 --- a/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMerge.java +++ b/cavis-dnn/cavis-dnn-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasMerge.java @@ -21,6 +21,7 @@ package org.deeplearning4j.nn.modelimport.keras.layers.core; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; import org.deeplearning4j.nn.conf.graph.ElementWiseVertex; import org.deeplearning4j.nn.conf.graph.MergeVertex; @@ -35,6 +36,7 @@ import java.util.Map; @Slf4j @Data +@EqualsAndHashCode(callSuper = false) public class KerasMerge extends KerasLayer { private final String LAYER_FIELD_MODE = "mode"; diff --git a/cavis-dnn/cavis-dnn-nn-parent/cavis-dnn-nn-core/src/main/java/org/deeplearning4j/clustering/vptree/VPTree.java b/cavis-dnn/cavis-dnn-nn-parent/cavis-dnn-nn-core/src/main/java/org/deeplearning4j/clustering/vptree/VPTree.java index 417154cf2..e15f8b9fc 100644 --- a/cavis-dnn/cavis-dnn-nn-parent/cavis-dnn-nn-core/src/main/java/org/deeplearning4j/clustering/vptree/VPTree.java +++ b/cavis-dnn/cavis-dnn-nn-parent/cavis-dnn-nn-core/src/main/java/org/deeplearning4j/clustering/vptree/VPTree.java @@ -55,11 +55,13 @@ public class VPTree implements Serializable { private Node root; private String similarityFunction; @Getter + @Builder.Default private boolean invert = false; private transient ExecutorService executorService; @Getter + @Builder.Default private int workers = 1; - private AtomicInteger size = new AtomicInteger(0); + @Builder.Default private AtomicInteger size = new AtomicInteger(0); private transient ThreadLocal scalars = new ThreadLocal<>(); diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/Histogram.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/Histogram.java index b5f4a5107..74f60a603 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/Histogram.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/Histogram.java @@ -21,11 +21,13 @@ package org.deeplearning4j.eval.curves; import lombok.Data; +import lombok.EqualsAndHashCode; import org.nd4j.evaluation.curves.BaseHistogram; import com.fasterxml.jackson.annotation.JsonProperty; @Deprecated @Data +@EqualsAndHashCode(callSuper = false) public class Histogram extends org.nd4j.evaluation.curves.Histogram { /** diff --git a/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-core/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java b/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-core/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java index 8d8532e0b..3a2170bc3 100644 --- a/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-core/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java +++ b/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-core/src/main/java/org/deeplearning4j/spark/impl/paramavg/ParameterAveragingTrainingMaster.java @@ -76,8 +76,9 @@ import static com.google.common.base.Preconditions.checkArgument; @JsonIgnoreProperties({"stats", "listeners", "iterationCount", "rng", "lastExportedRDDId", "lastRDDExportPath", "trainingMasterUID"}) @EqualsAndHashCode(exclude = {"stats", "listeners", "iterationCount", "rng", "lastExportedRDDId", "lastRDDExportPath", - "trainingMasterUID"}) + "trainingMasterUID"}, callSuper = false) @Slf4j + public class ParameterAveragingTrainingMaster extends BaseTrainingMaster implements TrainingMaster { diff --git a/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/training/SharedTrainingMaster.java b/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/training/SharedTrainingMaster.java index c55b3268a..fcd13d516 100644 --- a/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/training/SharedTrainingMaster.java +++ b/cavis-dnn/cavis-dnn-spark/cavis-dnn-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/training/SharedTrainingMaster.java @@ -21,6 +21,7 @@ package org.deeplearning4j.spark.parameterserver.training; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -100,7 +101,7 @@ import java.util.concurrent.atomic.AtomicInteger; */ @Slf4j @Data - +@EqualsAndHashCode(callSuper = false) public class SharedTrainingMaster extends BaseTrainingMaster implements TrainingMaster { //Static counter/id fields used to determine which training master last set up the singleton param servers, etc diff --git a/cavis-nd4j/cavis-nd4j-parameter-server/cavis-nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java b/cavis-nd4j/cavis-nd4j-parameter-server/cavis-nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java index b1b2d6abc..72bf20ecf 100644 --- a/cavis-nd4j/cavis-nd4j-parameter-server/cavis-nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java +++ b/cavis-nd4j/cavis-nd4j-parameter-server/cavis-nd4j-parameter-server-client/src/main/java/org/nd4j/parameterserver/client/ParameterServerClient.java @@ -53,16 +53,16 @@ public class ParameterServerClient implements NDArrayCallback { //port to listen on for the subscriber private int subscriberPort; //the stream to listen on for the subscriber - private int subscriberStream = 11; + @Builder.Default private int subscriberStream = 11; //the "current" ndarray private AtomicReference arr; - private INDArray none = Nd4j.scalar(1.0); + @Builder.Default private INDArray none = Nd4j.scalar(1.0); private AtomicBoolean running; private String masterStatusHost; private int masterStatusPort; - private ObjectMapper objectMapper = new ObjectMapper(); + @Builder.Default private ObjectMapper objectMapper = new ObjectMapper(); private Aeron aeron; - private boolean compressArray = true; + @Builder.Default private boolean compressArray = true; /** * Tracks number of diff --git a/cavis-zoo/cavis-zoo-models/src/main/java/org/deeplearning4j/zoo/model/TextGenerationLSTM.java b/cavis-zoo/cavis-zoo-models/src/main/java/org/deeplearning4j/zoo/model/TextGenerationLSTM.java index 9751db1a7..2a3475903 100644 --- a/cavis-zoo/cavis-zoo-models/src/main/java/org/deeplearning4j/zoo/model/TextGenerationLSTM.java +++ b/cavis-zoo/cavis-zoo-models/src/main/java/org/deeplearning4j/zoo/model/TextGenerationLSTM.java @@ -47,7 +47,7 @@ public class TextGenerationLSTM extends ZooModel { @Builder.Default private long seed = 1234; @Builder.Default private int maxLength = 40; @Builder.Default private int totalUniqueCharacters = 47; - private int[] inputShape = new int[] {maxLength, totalUniqueCharacters}; + @Builder.Default private int[] inputShape = new int[] {maxLength, totalUniqueCharacters}; @Builder.Default private IUpdater updater = new RmsProp(0.01); @Builder.Default private CacheMode cacheMode = CacheMode.NONE; @Builder.Default private WorkspaceMode workspaceMode = WorkspaceMode.ENABLED;