Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/VectorUnrollingNonlinearLeastSquaresConstantOptimizationEvaluator.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/VectorUnrollingNonlinearLeastSquaresConstantOptimizationEvaluator.cs	(revision 18236)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/VectorUnrollingNonlinearLeastSquaresConstantOptimizationEvaluator.cs	(revision 18237)
@@ -182,12 +182,9 @@
       int i = 0;
       foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTerminalNode>()) {
-        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
-        VariableTreeNodeBase variableTreeNodeBase = node as VariableTreeNodeBase;
-        FactorVariableTreeNode factorVarTreeNode = node as FactorVariableTreeNode;
-        if (constantTreeNode != null)
+        if (node is ConstantTreeNode constantTreeNode) {
           constantTreeNode.Value = constants[i++];
-        else if (updateVariableWeights && variableTreeNodeBase != null)
+        } else if (updateVariableWeights && node is VariableTreeNodeBase variableTreeNodeBase) {
           variableTreeNodeBase.Weight = constants[i++];
-        else if (factorVarTreeNode != null) {
+        } else if (node is FactorVariableTreeNode factorVarTreeNode) {
           for (int j = 0; j < factorVarTreeNode.Weights.Length; j++)
             factorVarTreeNode.Weights[j] = constants[i++];
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToTensorConverter.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToTensorConverter.cs	(revision 18236)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToTensorConverter.cs	(revision 18237)
@@ -120,4 +120,5 @@
       if (node.Symbol is Addition) {
         var terms = node.Subtrees.Select(ConvertNode).ToList();
+        if (terms.Count == 1) return terms[0];
         return terms.Aggregate((a, b) => a + b);
       }
@@ -131,4 +132,5 @@
       if (node.Symbol is Multiplication) {
         var terms = node.Subtrees.Select(ConvertNode).ToList();
+        if (terms.Count == 1) return terms[0];
         return terms.Aggregate((a, b) => a * b);
       }
@@ -152,10 +154,10 @@
 
       if (node.Symbol is Logarithm) {
-        return math_ops.log(
+        return tf.log(
           ConvertNode(node.GetSubtree(0)));
       }
 
       if (node.Symbol is Exponential) {
-        return math_ops.pow(
+        return tf.pow(
           (float)Math.E,
           ConvertNode(node.GetSubtree(0)));
@@ -168,15 +170,15 @@
 
       if (node.Symbol is SquareRoot) {
-        return math_ops.sqrt(
+        return tf.sqrt(
           ConvertNode(node.GetSubtree(0)));
       }
 
       if (node.Symbol is Cube) {
-        return math_ops.pow(
+        return tf.pow(
           ConvertNode(node.GetSubtree(0)), 3.0f);
       }
 
       if (node.Symbol is CubeRoot) {
-        return math_ops.pow(
+        return tf.pow(
           ConvertNode(node.GetSubtree(0)), 1.0f / 3.0f);
         // TODO
@@ -207,10 +209,19 @@
       }
 
-      //if (node.Symbol is StandardDeviation) {
-      //  return tf.reduce_std(
-      //    ConvertNode(node.GetSubtree(0)),
-      //    axis: new [] { 1 }
-      // );
-      //}
+      if (node.Symbol is StandardDeviation) {
+        return reduce_std(
+          ConvertNode(node.GetSubtree(0)),
+          axis: new[] { 1 },
+          keepdims: true
+       );
+      }
+
+      if (node.Symbol is Variance) {
+        return reduce_var(
+          ConvertNode(node.GetSubtree(0)),
+          axis: new[] { 1 } ,
+          keepdims: true
+        );
+      }
 
       if (node.Symbol is Sum) {
@@ -220,4 +231,20 @@
           keepdims: true);
       }
+
+      if (node.Symbol is SubVector) {
+        var tensor = ConvertNode(node.GetSubtree(0));
+        int rows = tensor.shape[0], vectorLength = tensor.shape[1];
+        var windowedNode = (IWindowedSymbolTreeNode)node;
+        int startIdx = SymbolicDataAnalysisExpressionTreeVectorInterpreter.ToVectorIdx(windowedNode.Offset, vectorLength);
+        int endIdx = SymbolicDataAnalysisExpressionTreeVectorInterpreter.ToVectorIdx(windowedNode.Length, vectorLength);
+        var slices = SymbolicDataAnalysisExpressionTreeVectorInterpreter.GetVectorSlices(startIdx, endIdx, vectorLength);
+
+        var segments = new List<Tensor>();
+        foreach (var (start, count) in slices) {
+          segments.Add(tensor[new Slice(), new Slice(start, start + count)]);
+        }
+        return tf.concat(segments.ToArray(), axis: 1);
+      }
+
 
       if (node.Symbol is StartSymbol) {
@@ -237,8 +264,17 @@
         }
 
-        return tf.reduce_sum(prediction, axis: new[] { 1 });
+        return tf.reshape(prediction, shape: new[] { -1 });
       }
 
       throw new NotSupportedException($"Node symbol {node.Symbol} is not supported.");
+    }
+
+    private static Tensor reduce_var(Tensor input_tensor,  int[] axis = null, bool keepdims = false) {
+      var means = tf.reduce_mean(input_tensor, axis, true);
+      var squared_deviation = tf.square(input_tensor - means);
+      return tf.reduce_mean(squared_deviation, axis, keepdims);
+    }
+    private static Tensor reduce_std(Tensor input_tensor, int[] axis = null, bool keepdims = false) {
+      return tf.sqrt(reduce_var(input_tensor, axis, keepdims));
     }
 
@@ -271,6 +307,8 @@
           !(n.Symbol is CubeRoot) &&
           !(n.Symbol is Mean) &&
-          //!(n.Symbol is StandardDeviation) &&
-          !(n.Symbol is Sum)
+          !(n.Symbol is StandardDeviation) &&
+          !(n.Symbol is Variance) &&
+          !(n.Symbol is Sum) &&
+          !(n.Symbol is SubVector)
         select n).Any();
       return !containsUnknownSymbol;
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 18236)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 18237)
@@ -339,5 +339,5 @@
       { typeof(NumberPeaksOfSize), OpCodes.NumberPeaksOfSize },
       { typeof(LargeNumberOfPeaks), OpCodes.LargeNumberOfPeaks },
-      { typeof(TimeReversalAsymmetryStatistic), OpCodes.TimeReversalAsymmetryStatistic },              
+      { typeof(TimeReversalAsymmetryStatistic), OpCodes.TimeReversalAsymmetryStatistic },
       #endregion
     };
