From 58e3527bf6737a14397145b031c1cdb56fcfd500 Mon Sep 17 00:00:00 2001 From: dariuszzbyrad Date: Fri, 11 Sep 2020 02:59:37 +0200 Subject: [PATCH] (arbiter-core) Made some performance and memory improvement (#9085) * Inline variables Signed-off-by: Dariusz Zbyrad * Marked some classes as static Signed-off-by: Dariusz Zbyrad * Improve computational complexity Signed-off-by: Dariusz Zbyrad * Revert last changes Signed-off-by: Dariusz Zbyrad --- .../arbiter/optimize/runner/BaseOptimizationRunner.java | 3 +-- .../main/java/org/deeplearning4j/arbiter/util/LeafUtils.java | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/runner/BaseOptimizationRunner.java b/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/runner/BaseOptimizationRunner.java index 3f6a887a3..65c2de0dc 100644 --- a/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/runner/BaseOptimizationRunner.java +++ b/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/optimize/runner/BaseOptimizationRunner.java @@ -330,8 +330,7 @@ public abstract class BaseOptimizationRunner implements IOptimizationRunner { @Override public List getCandidateStatus() { - List list = new ArrayList<>(currentStatus.values()); - return list; + return new ArrayList<>(currentStatus.values()); } private boolean terminate() { diff --git a/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/util/LeafUtils.java b/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/util/LeafUtils.java index 2a86dc48f..2a4abe79d 100644 --- a/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/util/LeafUtils.java +++ b/arbiter/arbiter-core/src/main/java/org/deeplearning4j/arbiter/util/LeafUtils.java @@ -42,6 +42,7 @@ public class LeafUtils { for (ParameterSpace q : unique) { if (p == q) { found = true; + break; } } if (!found) {