You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by mb...@apache.org on 2022/09/03 20:22:02 UTC

[systemds] branch main updated (b20779a62a -> 422cc04219)

This is an automated email from the ASF dual-hosted git repository.

mboehm7 pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


    from b20779a62a [SYSTEMDS-3433] Python docs test fail in IDE
     new 58c6cf8cd7 [MINOR] Cleanup misc warnings and formatting issues
     new 422cc04219 [SYSTEMDS-3435] Fix robustness of multi-class svm for missing classes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 scripts/builtin/l2svm.dml                          |  53 ++++----
 scripts/builtin/msvm.dml                           |  49 ++++----
 .../compress/colgroup/ADictBasedColGroup.java      |   1 +
 .../federated/monitoring/models/BaseModel.java     |   1 +
 .../models/CoordinatorConnectionModel.java         |   1 +
 .../monitoring/models/CoordinatorModel.java        |   1 +
 .../monitoring/models/DataObjectModel.java         |   2 +-
 .../federated/monitoring/models/EventModel.java    |   2 +-
 .../monitoring/models/EventStageModel.java         |   2 +-
 .../federated/monitoring/models/RequestModel.java  |   2 +-
 .../monitoring/models/StatisticsModel.java         |   1 +
 .../monitoring/models/StatisticsOptions.java       |   1 +
 .../federated/monitoring/models/TrafficModel.java  |   2 +-
 .../monitoring/models/UtilizationModel.java        |   2 +-
 .../federated/monitoring/models/WorkerModel.java   |   1 +
 .../paramserv/FederatedPSControlThread.java        |  23 ++--
 .../paramserv/homomorphicEncryption/PublicKey.java |  18 +--
 .../homomorphicEncryption/SEALServer.java          | 134 ++++++++++-----------
 .../instructions/cp/TernaryCPInstruction.java      |  22 +++-
 .../ColGroupMorphingPerformanceCompare.java        |   2 +-
 .../compress/colgroup/ColGroupNegativeTests.java   |   7 ++
 21 files changed, 177 insertions(+), 150 deletions(-)


[systemds] 02/02: [SYSTEMDS-3435] Fix robustness of multi-class svm for missing classes

Posted by mb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git

commit 422cc0421985d88491c1a58c11652693c77f2417
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Sat Sep 3 22:13:42 2022 +0200

    [SYSTEMDS-3435] Fix robustness of multi-class svm for missing classes
    
    This patch fixes issues of multi-class SVM with scenarios where the
    training data does not contain all classes in [1,max class ID]. We
    now only train one-against-the-rest models if a class exists in at
    least one training example.
    
    Furthermore, this patch also adds support for ternary ifelse scalar
    operations with string arguments which so far always evaluated to "0.0",
    but was used in verbose debug output of MSVM calling L2SVM.
    
    Finally, the documentation of MSVM and L2SVM has been cleaned up to
    make the descriptions more understandable, add expected shapes, and
    remove non-existing parameters.
---
 scripts/builtin/l2svm.dml                          | 53 ++++++++++------------
 scripts/builtin/msvm.dml                           | 49 +++++++++++---------
 .../instructions/cp/TernaryCPInstruction.java      | 22 ++++++---
 3 files changed, 68 insertions(+), 56 deletions(-)

diff --git a/scripts/builtin/l2svm.dml b/scripts/builtin/l2svm.dml
index cdcc1ba4df..8b25915625 100644
--- a/scripts/builtin/l2svm.dml
+++ b/scripts/builtin/l2svm.dml
@@ -19,27 +19,29 @@
 #
 #-------------------------------------------------------------
 
-# Builtin function Implements binary-class SVM with squared slack variables
+# This builting function implements binary-class Support Vector Machine (SVM)
+# with squared slack variables (l2 regularization).
 #
 # INPUT:
-# -----------------------------------------------------------------------------------------
-# X              matrix X of feature vectors
-# Y              matrix Y of class labels have to be a single column
-# intercept      No Intercept ( If set to TRUE then a constant bias column is added to X)
-# epsilon        Procedure terminates early if the reduction in objective function value is less
-#                than epsilon (tolerance) times the initial objective function value.
-# reg            Regularization parameter (reg) for L2 regularization
-# maxIterations  Maximum number of conjugate gradient iterations
-# maxii          max inner for loop iterations
-# verbose        Set to true if one wants print statements updating on loss.
-# columnId       The column Id used if one wants to add a ID to the print statement, 
+# ------------------------------------------------------------------------------
+# X              Feature matrix X (shape: m x n)
+# Y              Label vector y of class labels (shape: m x 1), assumed binary
+#                in -1/+1 or 1/2 encoding.
+# intercept      Indicator if a bias column should be added to X and the model
+# epsilon        Tolerance for early termination if the reduction of objective
+#                function is less than epsilon times the initial objective
+# reg            Regularization parameter (lambda) for L2 regularization
+# maxIterations  Maximum number of conjugate gradient (outer) iterations
+# maxii          Maximum number of line search (inner) iterations
+# verbose        Indicator if training details should be printed
+# columnId       An optional class ID used in verbose print output,
 #                eg. used when L2SVM is used in MSVM.
-# -----------------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------
 #
 # OUTPUT:
-# ------------------------------------------------------------------------------------------
-# model  the trained model
-# ------------------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------
+# model          Trained model/weights (shape: n x 1, w/ intercept: n+1)
+# ------------------------------------------------------------------------------
 
 m_l2svm = function(Matrix[Double] X, Matrix[Double] Y, Boolean intercept = FALSE,
     Double epsilon = 0.001, Double reg = 1, Integer maxIterations = 100, 
@@ -73,29 +75,22 @@ m_l2svm = function(Matrix[Double] X, Matrix[Double] Y, Boolean intercept = FALSE
   if(check_min != -1 | check_max != +1)
     Y = 2/(check_max - check_min)*Y - (check_min + check_max)/(check_max - check_min)
     
-  # If column_id is -1 then we assume that the fundamental algorithm is MSVM, 
-  # Therefore don't print message.
+  # If column_id is -1 then we assume that it's called from within MSVM
   if(verbose & columnId == -1)
     print('Running L2-SVM ')
 
-  num_samples = nrow(X)
-  num_classes = ncol(Y)
-  
   # Add Bias 
-  num_rows_in_w = ncol(X)
   if (intercept) {
-    ones  = matrix(1, rows=num_samples, cols=1)
+    ones  = matrix(1, rows=nrow(X), cols=1)
     X = cbind(X, ones);
-    num_rows_in_w += 1
   }
   
-  w = matrix(0, rows=num_rows_in_w, cols=1)
+  w = matrix(0, rows=ncol(X), cols=1)
+  Xw = matrix(0, rows=nrow(X), cols=1)
 
   g_old = t(X) %*% Y
   s = g_old
 
-  Xw = matrix(0, rows=nrow(X), cols=1)
-
   iter = 0
   continue = TRUE
   while(continue & iter < maxIterations)  {
@@ -129,8 +124,8 @@ m_l2svm = function(Matrix[Double] X, Matrix[Double] Y, Boolean intercept = FALSE
     g_new = t(X) %*% (out * Y) - reg * w
 
     if(verbose) {
-      colstr = ifelse(columnId!=-1, ", Col:"+columnId + " ,", " ,")
-      print("Iter: " + toString(iter) + " InnerIter: " + toString(iiter) +" --- "+ colstr + " Obj:" + obj)
+      colstr = ifelse(columnId!=-1, "-- MSVM class="+columnId+": ", "")
+      print(colstr + "Iter: " + iter + " InnerIter: " + iiter +" --- " + " Obj:" + obj)
     }
 
     tmp = sum(s * g_old)
diff --git a/scripts/builtin/msvm.dml b/scripts/builtin/msvm.dml
index 4bf904f822..076b9eb597 100644
--- a/scripts/builtin/msvm.dml
+++ b/scripts/builtin/msvm.dml
@@ -19,26 +19,27 @@
 #
 #-------------------------------------------------------------
 
-# Implements builtin multi-class SVM with squared slack variables, 
-# learns one-against-the-rest binary-class classifiers by making a function call to l2SVM
+# This builtin function implements a multi-class Support Vector Machine (SVM)
+# with squared slack variables. The trained model comprises #classes
+# one-against-the-rest binary-class l2svm classification models.
 #
 # INPUT:
-#------------------------------------------------------------------------------------------
-# X              matrix X of feature vectors
-# Y              matrix Y of class labels
-# intercept      No Intercept ( If set to TRUE then a constant bias column is added to X)
-# num_classes    Number of classes
-# epsilon        Procedure terminates early if the reduction in objective function
-#                value is less than epsilon (tolerance) times the initial objective function value.
+#-------------------------------------------------------------------------------
+# X              Feature matrix X (shape: m x n)
+# Y              Label vector y of class labels (shape: m x 1),
+#                where max(Y) is assumed to be the number of classes
+# intercept      Indicator if a bias column should be added to X and the model
+# epsilon        Tolerance for early termination if the reduction of objective
+#                function is less than epsilon times the initial objective
 # reg            Regularization parameter (lambda) for L2 regularization
-# maxIterations  Maximum number of conjugate gradient iterations
-# verbose        Set to true to print while training.
-# -----------------------------------------------------------------------------------------
+# maxIterations  Maximum number of conjugate gradient (outer l2svm) iterations
+# verbose        Indicator if training details should be printed
+# ------------------------------------------------------------------------------
 #
 # OUTPUT:
-#-----------------------------------------------------------------------------------
-# model  model matrix
-#-----------------------------------------------------------------------------------
+#-------------------------------------------------------------------------------
+# model          Trained model/weights (shape: n x max(Y), w/ intercept: n+1)
+#-------------------------------------------------------------------------------
 
 m_msvm = function(Matrix[Double] X, Matrix[Double] Y, Boolean intercept = FALSE,
     Double epsilon = 0.001, Double reg = 1.0, Integer maxIterations = 100,
@@ -55,25 +56,31 @@ m_msvm = function(Matrix[Double] X, Matrix[Double] Y, Boolean intercept = FALSE,
     print("msvm: matrix X contains "+numNaNs+" missing values, replacing with 0.")
     X = replace(target=X, pattern=NaN, replacement=0);
   }
-  num_rows_in_w = ncol(X)
+  # append once, and call l2svm always with intercept=FALSE
   if(intercept) {
-    # append once, and call l2svm always with intercept=FALSE 
     ones = matrix(1, rows=nrow(X), cols=1)
     X = cbind(X, ones);
-    num_rows_in_w += 1
   }
 
   if(ncol(Y) > 1)
-    Y = rowMaxs(Y * t(seq(1,ncol(Y))))
+    Y = rowIndexMax(Y)
 
   # Assuming number of classes to be max contained in Y
-  w = matrix(0, rows=num_rows_in_w, cols=max(Y))
+  w = matrix(0, rows=ncol(X), cols=max(Y))
 
   parfor(class in 1:max(Y)) {
+    # extract the class' binary labels and convert to -1/+1
     Y_local = 2 * (Y == class) - 1
-    w[,class] = l2svm(X=X, Y=Y_local, intercept=FALSE,
+    # train l2svm model with robustness for non-existing classes
+    nnzY = sum(Y == class);
+    if( nnzY > 0 ) {
+      w[,class] = l2svm(X=X, Y=Y_local, intercept=FALSE,
         epsilon=epsilon, reg=reg, maxIterations=maxIterations,
         verbose=verbose, columnId=class)
+    }
+    else {
+      w[,class] = matrix(-Inf, ncol(X), 1);
+    }
   }
 
   model = w
diff --git a/src/main/java/org/apache/sysds/runtime/instructions/cp/TernaryCPInstruction.java b/src/main/java/org/apache/sysds/runtime/instructions/cp/TernaryCPInstruction.java
index 86733fb06f..76a8924ae1 100644
--- a/src/main/java/org/apache/sysds/runtime/instructions/cp/TernaryCPInstruction.java
+++ b/src/main/java/org/apache/sysds/runtime/instructions/cp/TernaryCPInstruction.java
@@ -19,7 +19,9 @@
 
 package org.apache.sysds.runtime.instructions.cp;
 
+import org.apache.sysds.common.Types.ValueType;
 import org.apache.sysds.runtime.controlprogram.context.ExecutionContext;
+import org.apache.sysds.runtime.functionobjects.IfElse;
 import org.apache.sysds.runtime.instructions.InstructionUtils;
 import org.apache.sysds.runtime.matrix.data.MatrixBlock;
 import org.apache.sysds.runtime.matrix.operators.TernaryOperator;
@@ -71,12 +73,20 @@ public class TernaryCPInstruction extends ComputationCPInstruction {
 			ec.setMatrixOutput(output.getName(), out);
 		}
 		else { //SCALARS
-			double value = ((TernaryOperator)_optr).fn.execute(
-				ec.getScalarInput(input1).getDoubleValue(),
-				ec.getScalarInput(input2).getDoubleValue(),
-				ec.getScalarInput(input3).getDoubleValue());
-			ec.setScalarOutput(output.getName(), ScalarObjectFactory
-				.createScalarObject(output.getValueType(), value));
+			if( ((TernaryOperator)_optr).fn instanceof IfElse
+				&& output.getValueType() == ValueType.STRING) {
+				String value = (ec.getScalarInput(input1).getDoubleValue() != 0 ?
+					ec.getScalarInput(input2) : ec.getScalarInput(input3)).getStringValue();
+				ec.setScalarOutput(output.getName(), new StringObject(value));
+			}
+			else {
+				double value = ((TernaryOperator)_optr).fn.execute(
+					ec.getScalarInput(input1).getDoubleValue(),
+					ec.getScalarInput(input2).getDoubleValue(),
+					ec.getScalarInput(input3).getDoubleValue());
+				ec.setScalarOutput(output.getName(), ScalarObjectFactory
+					.createScalarObject(output.getValueType(), value));
+			}
 		}
 	}
 }


[systemds] 01/02: [MINOR] Cleanup misc warnings and formatting issues

Posted by mb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git

commit 58c6cf8cd76270a9b4d73043d89eb6077a313431
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Sat Sep 3 19:53:14 2022 +0200

    [MINOR] Cleanup misc warnings and formatting issues
---
 .../compress/colgroup/ADictBasedColGroup.java      |   1 +
 .../federated/monitoring/models/BaseModel.java     |   1 +
 .../models/CoordinatorConnectionModel.java         |   1 +
 .../monitoring/models/CoordinatorModel.java        |   1 +
 .../monitoring/models/DataObjectModel.java         |   2 +-
 .../federated/monitoring/models/EventModel.java    |   2 +-
 .../monitoring/models/EventStageModel.java         |   2 +-
 .../federated/monitoring/models/RequestModel.java  |   2 +-
 .../monitoring/models/StatisticsModel.java         |   1 +
 .../monitoring/models/StatisticsOptions.java       |   1 +
 .../federated/monitoring/models/TrafficModel.java  |   2 +-
 .../monitoring/models/UtilizationModel.java        |   2 +-
 .../federated/monitoring/models/WorkerModel.java   |   1 +
 .../paramserv/FederatedPSControlThread.java        |  23 ++--
 .../paramserv/homomorphicEncryption/PublicKey.java |  18 +--
 .../homomorphicEncryption/SEALServer.java          | 134 ++++++++++-----------
 .../ColGroupMorphingPerformanceCompare.java        |   2 +-
 .../compress/colgroup/ColGroupNegativeTests.java   |   7 ++
 18 files changed, 109 insertions(+), 94 deletions(-)

diff --git a/src/main/java/org/apache/sysds/runtime/compress/colgroup/ADictBasedColGroup.java b/src/main/java/org/apache/sysds/runtime/compress/colgroup/ADictBasedColGroup.java
index 0efdb4aa56..dc09fe9877 100644
--- a/src/main/java/org/apache/sysds/runtime/compress/colgroup/ADictBasedColGroup.java
+++ b/src/main/java/org/apache/sysds/runtime/compress/colgroup/ADictBasedColGroup.java
@@ -35,6 +35,7 @@ import org.apache.sysds.runtime.data.SparseBlock;
 import org.apache.sysds.runtime.matrix.data.MatrixBlock;
 
 public abstract class ADictBasedColGroup extends AColGroupCompressed {
+	private static final long serialVersionUID = -3737025296618703668L;
 	/** Distinct value tuples associated with individual bitmaps. */
 	protected ADictionary _dict;
 
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/BaseModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/BaseModel.java
index dbd3320c01..3d1f5e9205 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/BaseModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/BaseModel.java
@@ -22,5 +22,6 @@ package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 import java.io.Serializable;
 
 public abstract class BaseModel implements Serializable {
+	private static final long serialVersionUID = 5565981270528383999L;
 	public Long id;
 }
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorConnectionModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorConnectionModel.java
index dc28232225..08965ad1b5 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorConnectionModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorConnectionModel.java
@@ -20,6 +20,7 @@
 package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 
 public abstract class CoordinatorConnectionModel extends BaseModel {
+	private static final long serialVersionUID = 918360814223266197L;
 	public Long coordinatorId;
 	private String coordinatorHostId;
 	private static final String localhostIp = "127.0.0.1";
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorModel.java
index 98f25ee267..08a6938735 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/CoordinatorModel.java
@@ -20,6 +20,7 @@
 package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 
 public class CoordinatorModel extends BaseModel {
+	private static final long serialVersionUID = 4116787631938152573L;
 	public String name;
 	public String host;
 	public Long processId;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/DataObjectModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/DataObjectModel.java
index 5e20ba2887..c6c14e7390 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/DataObjectModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/DataObjectModel.java
@@ -20,7 +20,7 @@
 package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 
 public class DataObjectModel extends BaseModel {
-
+	private static final long serialVersionUID = 7914784187151939188L;
 	public Long workerId;
 	public String varName;
 	public String dataType;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventModel.java
index fc4694c935..e3e4dc3398 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventModel.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.stream.Collectors;
 
 public class EventModel extends CoordinatorConnectionModel {
-
+	private static final long serialVersionUID = -5597621916956632690L;
 	public Long workerId;
 	private String coordinatorName;
 	public List<EventStageModel> stages;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventStageModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventStageModel.java
index 1171a7c25c..ee4205a124 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventStageModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/EventStageModel.java
@@ -22,7 +22,7 @@ package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 import java.time.LocalDateTime;
 
 public class EventStageModel extends BaseModel {
-
+	private static final long serialVersionUID = -6867424341266726981L;
 	public Long eventId;
 	public String operation;
 	public LocalDateTime startTime;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/RequestModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/RequestModel.java
index 81171e9311..ff971c129e 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/RequestModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/RequestModel.java
@@ -20,7 +20,7 @@
 package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 
 public class RequestModel extends CoordinatorConnectionModel {
-
+	private static final long serialVersionUID = -5376072120202921000L;
 	public Long workerId;
 	public String type;
 	public Long count;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsModel.java
index cdbe6e73c5..613b286a27 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsModel.java
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.stream.Collectors;
 
 public class StatisticsModel extends BaseModel {
+	private static final long serialVersionUID = -2492467768854934429L;
 	public List<UtilizationModel> utilization;
 	public List<TrafficModel> traffic;
 	public List<EventModel> events;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsOptions.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsOptions.java
index bcbc57357d..cbbf4cd915 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsOptions.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/StatisticsOptions.java
@@ -20,6 +20,7 @@
 package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 
 public class StatisticsOptions extends BaseModel {
+	private static final long serialVersionUID = 2524032122999491726L;
 	public int rowCount = 20;
 	public boolean utilization = true;
 	public boolean traffic = true;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/TrafficModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/TrafficModel.java
index 9d0d1d160e..617324da64 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/TrafficModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/TrafficModel.java
@@ -22,7 +22,7 @@ package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 import java.time.LocalDateTime;
 
 public class TrafficModel extends CoordinatorConnectionModel {
-
+	private static final long serialVersionUID = 5042814368347405998L;
 	public Long workerId;
 	public LocalDateTime timestamp;
 	public Long byteAmount;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/UtilizationModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/UtilizationModel.java
index d92555a3ee..b3b1076814 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/UtilizationModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/UtilizationModel.java
@@ -22,7 +22,7 @@ package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 import java.time.LocalDateTime;
 
 public class UtilizationModel extends BaseModel {
-
+	private static final long serialVersionUID = 6984053518916899551L;
 	public Long workerId;
 	public LocalDateTime timestamp;
 	public double cpuUsage;
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/WorkerModel.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/WorkerModel.java
index 922fe9239a..f1065b1bae 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/WorkerModel.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/monitoring/models/WorkerModel.java
@@ -20,6 +20,7 @@
 package org.apache.sysds.runtime.controlprogram.federated.monitoring.models;
 
 public class WorkerModel extends BaseModel {
+	private static final long serialVersionUID = -7516912892237220796L;
 	public String name;
 	public String address;
 
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/FederatedPSControlThread.java b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/FederatedPSControlThread.java
index 0c984698c1..09fd0a3349 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/FederatedPSControlThread.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/FederatedPSControlThread.java
@@ -293,14 +293,14 @@ public class FederatedPSControlThread extends PSWorker implements Callable<Void>
 
 		byte[] _partial_pubkey_a;
 
-        protected SetupHEFederatedWorker(byte[] partial_pubkey_a) {
-            // delegate everything to parent class. set modelAvg to true, as it is the only supported case
-            super();
-            _partial_pubkey_a = partial_pubkey_a;
-        }
-
-        @Override
-        public FederatedResponse execute(ExecutionContext ec, Data... data) {
+		protected SetupHEFederatedWorker(byte[] partial_pubkey_a) {
+			// delegate everything to parent class. set modelAvg to true, as it is the only supported case
+			super();
+			_partial_pubkey_a = partial_pubkey_a;
+		}
+
+		@Override
+		public FederatedResponse execute(ExecutionContext ec, Data... data) {
 			// TODO: set other CKKS parameters
 			// TODO generate partial public key
 			NativeHEHelper.initialize();
@@ -315,9 +315,10 @@ public class FederatedPSControlThread extends PSWorker implements Callable<Void>
 			}
 
 			return new FederatedResponse(FederatedResponse.ResponseType.SUCCESS, partial_pubkey);
-        }
-    }
-		/**
+		}
+	}
+	
+	/**
 	 * Teardown UDF executed on the federated worker
 	 */
 	private static class SetPublicKeyFederatedWorker extends FederatedUDF {
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/PublicKey.java b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/PublicKey.java
index 96fd415308..bb3dea4db7 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/PublicKey.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/PublicKey.java
@@ -22,15 +22,15 @@ package org.apache.sysds.runtime.controlprogram.paramserv.homomorphicEncryption;
 import java.io.Serializable;
 
 public class PublicKey implements Serializable {
-    private static final long serialVersionUID = 91289081237980123L;
+	private static final long serialVersionUID = 91289081237980123L;
 
-    private final byte[] _data;
+	private final byte[] _data;
 
-    public PublicKey(byte[] data) {
-        _data = data;
-    }
-
-    public byte[] getData() {
-        return _data;
-    }
+	public PublicKey(byte[] data) {
+		_data = data;
+	}
+	
+	public byte[] getData() {
+		return _data;
+	}
 }
diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/SEALServer.java b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/SEALServer.java
index d6265c7f6d..acf8509d91 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/SEALServer.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/homomorphicEncryption/SEALServer.java
@@ -35,78 +35,78 @@ import org.apache.sysds.runtime.meta.MetaDataFormat;
 import java.util.Arrays;
 
 public class SEALServer {
-    public SEALServer() {
-        // TODO take params here, like slot_count etc.
-        ctx = NativeHEHelper.initServer();
-    }
+	public SEALServer() {
+		// TODO take params here, like slot_count etc.
+		ctx = NativeHEHelper.initServer();
+	}
 
-    // this is a pointer to the context used by all native methods of this class
-    private final long ctx;
-    private byte[] _a;
+	// this is a pointer to the context used by all native methods of this class
+	private final long ctx;
+	private byte[] _a;
 
-    /**
-     * this generates the a constant. in a future version we want to generate this together with the clients to prevent misuse
-     * @return serialized a constant
-     */
-    public synchronized byte[] generateA() {
-        if (_a == null) {
-            _a = NativeHEHelper.generateA(ctx);
-        }
-        return _a;
-    }
+	/**
+	 * this generates the a constant. in a future version we want to generate this together with the clients to prevent misuse
+	 * @return serialized a constant
+	 */
+	public synchronized byte[] generateA() {
+		if (_a == null) {
+			_a = NativeHEHelper.generateA(ctx);
+		}
+		return _a;
+	}
 
-    /**
-     * accumulates the given partial public keys into a public key, stores it in ctx and returns it
-     * @param partial_public_keys an array of partial public keys generated with SEALServer::generatePartialPublicKey
-     * @return the aggregated public key
-     */
-    public PublicKey aggregatePartialPublicKeys(PublicKey[] partial_public_keys) {
-        return new PublicKey(NativeHEHelper.aggregatePartialPublicKeys(ctx, extractRawData(partial_public_keys)));
-    }
+	/**
+	 * accumulates the given partial public keys into a public key, stores it in ctx and returns it
+	 * @param partial_public_keys an array of partial public keys generated with SEALServer::generatePartialPublicKey
+	 * @return the aggregated public key
+	 */
+	public PublicKey aggregatePartialPublicKeys(PublicKey[] partial_public_keys) {
+		return new PublicKey(NativeHEHelper.aggregatePartialPublicKeys(ctx, extractRawData(partial_public_keys)));
+	}
 
-    /**
-     * accumulates the given ciphertext blocks into a sum ciphertext and returns it
-     * @param ciphertexts ciphertexts encrypted with the partial public keys
-     * @return the accumulated ciphertext (which is the homomorphic sum of ciphertexts)
-     */
-    public CiphertextMatrix accumulateCiphertexts(CiphertextMatrix[] ciphertexts) {
-        return new CiphertextMatrix(ciphertexts[0].getDims(), ciphertexts[0].getDataCharacteristics(), NativeHEHelper.accumulateCiphertexts(ctx, extractRawData(ciphertexts)));
-    }
+	/**
+	 * accumulates the given ciphertext blocks into a sum ciphertext and returns it
+	 * @param ciphertexts ciphertexts encrypted with the partial public keys
+	 * @return the accumulated ciphertext (which is the homomorphic sum of ciphertexts)
+	 */
+	public CiphertextMatrix accumulateCiphertexts(CiphertextMatrix[] ciphertexts) {
+		return new CiphertextMatrix(ciphertexts[0].getDims(), ciphertexts[0].getDataCharacteristics(), NativeHEHelper.accumulateCiphertexts(ctx, extractRawData(ciphertexts)));
+	}
 
-    /**
-     * averages the partial decryptions
-     * @param encrypted_sum is the result of accumulateCiphertexts()
-     * @param partial_plaintexts is the result of SEALServer::partiallyDecrypt of each ciphertext fed into accumulateCiphertexts
-     * @return the unencrypted, element-wise average of the original matrices
-     */
-    public MatrixObject average(CiphertextMatrix encrypted_sum, PlaintextMatrix[] partial_plaintexts) {
-        double[] raw_result = NativeHEHelper.average(ctx, encrypted_sum.getData(), extractRawData(partial_plaintexts));
-        int[] dims = encrypted_sum.getDims();
-        int result_len = Arrays.stream(dims).reduce(1, (x,y) -> x*y);
-        DataCharacteristics dc = encrypted_sum.getDataCharacteristics();
+	/**
+	 * averages the partial decryptions
+	 * @param encrypted_sum is the result of accumulateCiphertexts()
+	 * @param partial_plaintexts is the result of SEALServer::partiallyDecrypt of each ciphertext fed into accumulateCiphertexts
+	 * @return the unencrypted, element-wise average of the original matrices
+	 */
+	public MatrixObject average(CiphertextMatrix encrypted_sum, PlaintextMatrix[] partial_plaintexts) {
+		double[] raw_result = NativeHEHelper.average(ctx, encrypted_sum.getData(), extractRawData(partial_plaintexts));
+		int[] dims = encrypted_sum.getDims();
+		int result_len = Arrays.stream(dims).reduce(1, (x,y) -> x*y);
+		DataCharacteristics dc = encrypted_sum.getDataCharacteristics();
 
-        DenseBlock new_dense_block = DenseBlockFactory.createDenseBlock(Arrays.copyOf(raw_result, result_len), dims);
-        MatrixBlock new_matrix_block = new MatrixBlock((int)dc.getRows(), (int)dc.getCols(), new_dense_block);
-        MatrixObject new_mo = new MatrixObject(Types.ValueType.FP64, OptimizerUtils.getUniqueTempFileName(), new MetaDataFormat(dc, Types.FileFormat.BINARY));
-        new_mo.acquireModify(new_matrix_block);
-        new_mo.release();
-        return new_mo;
-    }
+		DenseBlock new_dense_block = DenseBlockFactory.createDenseBlock(Arrays.copyOf(raw_result, result_len), dims);
+		MatrixBlock new_matrix_block = new MatrixBlock((int)dc.getRows(), (int)dc.getCols(), new_dense_block);
+		MatrixObject new_mo = new MatrixObject(Types.ValueType.FP64, OptimizerUtils.getUniqueTempFileName(), new MetaDataFormat(dc, Types.FileFormat.BINARY));
+		new_mo.acquireModify(new_matrix_block);
+		new_mo.release();
+		return new_mo;
+	}
 
-    private static byte[][] extractRawData(Encrypted[] data) {
-        byte[][] raw_data = new byte[data.length][];
-        for (int i = 0; i < data.length; i++) {
-            raw_data[i] = data[i].getData();
-        }
-        return raw_data;
-    }
+	private static byte[][] extractRawData(Encrypted[] data) {
+		byte[][] raw_data = new byte[data.length][];
+		for (int i = 0; i < data.length; i++) {
+			raw_data[i] = data[i].getData();
+		}
+		return raw_data;
+	}
 
-    // TODO: extract an interface for this and use it here
-    private static byte[][] extractRawData(PublicKey[] data) {
-        byte[][] raw_data = new byte[data.length][];
-        for (int i = 0; i < data.length; i++) {
-            raw_data[i] = data[i].getData();
-        }
-        return raw_data;
-    }
-}
\ No newline at end of file
+	// TODO: extract an interface for this and use it here
+	private static byte[][] extractRawData(PublicKey[] data) {
+		byte[][] raw_data = new byte[data.length][];
+		for (int i = 0; i < data.length; i++) {
+			raw_data[i] = data[i].getData();
+		}
+		return raw_data;
+	}
+}
diff --git a/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupMorphingPerformanceCompare.java b/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupMorphingPerformanceCompare.java
index ca15628c64..14962b038a 100644
--- a/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupMorphingPerformanceCompare.java
+++ b/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupMorphingPerformanceCompare.java
@@ -150,7 +150,7 @@ public class ColGroupMorphingPerformanceCompare {
 	}
 
 	protected static class SDCNoMorph extends ColGroupSDC {
-
+		private static final long serialVersionUID = -7157464508602251065L;
 		private final MatrixBlock mbDict;
 
 		protected SDCNoMorph(int numRows) {
diff --git a/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupNegativeTests.java b/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupNegativeTests.java
index fb94a9a8c8..485584e4fa 100644
--- a/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupNegativeTests.java
+++ b/src/test/java/org/apache/sysds/test/component/compress/colgroup/ColGroupNegativeTests.java
@@ -138,6 +138,8 @@ public class ColGroupNegativeTests {
 	}
 
 	private class FakeIndexing extends IndexFunction {
+		private static final long serialVersionUID = -4099420257856761251L;
+
 		protected FakeIndexing() {
 		}
 
@@ -173,12 +175,16 @@ public class ColGroupNegativeTests {
 	}
 
 	private class FakeValueFunction extends ValueFunction {
+		private static final long serialVersionUID = -585186573175954738L;
+
 		private FakeValueFunction() {
 
 		}
 	}
 
 	private class FakeAPreAgg extends APreAgg {
+		private static final long serialVersionUID = 8759470530917794282L;
+
 		private FakeAPreAgg() {
 			super(new int[1], Dictionary.createNoCheck(new double[13]), null);
 		}
@@ -339,6 +345,7 @@ public class ColGroupNegativeTests {
 	}
 
 	private class FakeDictBasedColGroup extends ADictBasedColGroup {
+		private static final long serialVersionUID = 7578204757649117273L;
 
 		private FakeDictBasedColGroup() {
 			super(null, null);