j143 commented on a change in pull request #1026:
URL: https://github.com/apache/systemds/pull/1026#discussion_r473718157



##########
File path: scripts/nn/examples/mnist_2NN.dml
##########
@@ -20,159 +20,161 @@
 #-------------------------------------------------------------
 
 /*
- * MNIST 2NN Relu Example
- */
+* MNIST 2NN Leaky Relu Example
+*/
 
 # Imports
 source("nn/layers/affine.dml") as affine
 source("nn/layers/cross_entropy_loss.dml") as cross_entropy_loss
-source("nn/layers/relu.dml") as relu
+source("nn/layers/leaky_relu.dml") as leaky_relu
 source("nn/layers/softmax.dml") as softmax
 source("nn/optim/sgd_nesterov.dml") as sgd_nesterov
 
 train = function(matrix[double] X, matrix[double] Y,
-                 matrix[double] X_val, matrix[double] Y_val,
-                 int epochs)
-    return (matrix[double] W_1, matrix[double] b_1,
-            matrix[double] W_2, matrix[double] b_2,
-            matrix[double] W_3, matrix[double] b_3) {
-  /*
-   * Trains a 2NN relu softmax classifier.
-   *
-   * The input matrix, X, has N examples, each with D features.
-   * The targets, Y, have K classes, and are one-hot encoded.
-   *
-   * Inputs:
-   *  - X: Input data matrix, of shape (N, D).
-   *  - Y: Target matrix, of shape (N, K).
-   *  - X_val: Input validation data matrix, of shape (N, C*Hin*Win).
-   *  - Y_val: Target validation matrix, of shape (N, K).
-   *  - epochs: Total number of full training loops over the full data set.
-   *
-   * Outputs:
-   *  - W: Weights (parameters) matrix, of shape (D, M, 3).
-   *  - b: Biases vector, of shape (1, M, 3).
-   */
-  N = nrow(X)  # num examples
-  D = ncol(X)  # num features
-  K = ncol(Y)  # num classes
+matrix[double] X_val, matrix[double] Y_val,
+int epochs)
+return (matrix[double] W_1, matrix[double] b_1,
+matrix[double] W_2, matrix[double] b_2,
+matrix[double] W_3, matrix[double] b_3) {
 
-  # Create the network:
-  # input -> 200 neuron affine -> relu -> 200 neuron affine -> relu -> K 
neurons affine -> softmax
-  [W_1, b_1] = affine::init(D, 200)
-  [W_2, b_2] = affine::init(200, 200)
-  [W_3, b_3] = affine::init(200, K)
+/*
+* Trains a 2 hidden layer leaky relu softmax classifier.
+*
+* The input matrix, X, has N examples, each with D features.
+* The targets, Y, have K classes, and are one-hot encoded.
+*
+* Inputs:
+*  - X: Input data matrix, of shape (N, D).
+*  - Y: Target matrix, of shape (N, K).
+*  - X_val: Input validation data matrix, of shape (N, C*Hin*Win).
+*  - Y_val: Target validation matrix, of shape (N, K).
+*  - epochs: Total number of full training loops over the full data set.
+*
+* Outputs:
+*  - W: Weights (parameters) matrix, of shape (D, M, 3).
+*  - b: Biases vector, of shape (1, M, 3).
+*/
+

Review comment:
       This seems the formatting change. Can you revert this?

##########
File path: scripts/nn/examples/Example-MNIST_2NN_Leaky_ReLu_Softmax.dml
##########
@@ -20,12 +20,15 @@
 #-------------------------------------------------------------
 
 /*
- * The MNIST Data can be downloaded as follows:
- * mkdir -p data/mnist/
- * cd data/mnist/
- * curl -O https://pjreddie.com/media/files/mnist_train.csv
- * curl -O https://pjreddie.com/media/files/mnist_test.csv
- */
+* This Example trains a feed forward neural network with one input layer, two 
hidden affine layers (200 neurons) with
+* leaky relu activations and one affine output layer with a softmax activation

Review comment:
       These changes are only telling us what is added.
   
   But, not WHY these changes are added. If you have contacted any SystemDS 
developer offline, consider providing
   the summary of the discussion here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to