You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by zh...@apache.org on 2021/11/26 02:33:03 UTC

[singa] branch dev updated: Update data augmentation comments in largedataset_cnn example

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

zhaojing pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/singa.git


The following commit(s) were added to refs/heads/dev by this push:
     new 5840575  Update data augmentation comments in largedataset_cnn example
     new eec8ee2  Merge pull request #909 from NLGithubWP/update-the-comments
5840575 is described below

commit 5840575d8fc4cc0f5e07d55c2aed031fb21330a9
Author: nailixing <xi...@gmail.com>
AuthorDate: Thu Nov 25 16:06:21 2021 +0800

    Update data augmentation comments in largedataset_cnn example
---
 examples/largedataset_cnn/train_largedata.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/largedataset_cnn/train_largedata.py b/examples/largedataset_cnn/train_largedata.py
old mode 100644
new mode 100755
index 81f3e72..adba9ce
--- a/examples/largedataset_cnn/train_largedata.py
+++ b/examples/largedataset_cnn/train_largedata.py
@@ -27,7 +27,7 @@ import argparse
 from PIL import Image
 import process_data
 
-# Data Augmentation
+# Data augmentation
 def augmentation(x, batch_size):
     xpad = np.pad(x, [[0, 0], [0, 0], [4, 4], [4, 4]], 'symmetric')
     for data_num in range(0, batch_size):
@@ -41,7 +41,7 @@ def augmentation(x, batch_size):
     return x
 
 
-# Calculate Accuracy
+# Calculate accuracy
 def accuracy(pred, target):
     # y is network output to be compared with ground truth (int)
     y = np.argmax(pred, axis=1)
@@ -68,7 +68,7 @@ def partition(global_rank, world_size, train_x, train_y, val_x, val_y):
     return train_x, train_y, val_x, val_y
 
 
-# Function to all reduce NUMPY Accuracy and Loss from Multiple Devices
+# Function to all reduce NUMPY accuracy and loss from multiple devices
 def reduce_variable(variable, dist_opt, reducer):
     reducer.copy_from_numpy(variable)
     dist_opt.all_reduce(reducer.data)
@@ -130,7 +130,7 @@ def run(global_rank,
         model = alexnet.create_model(num_channels=num_channels,
                                      num_classes=num_classes)
 
-    # For distributed training, sequential gives better performance
+    # For distributed training, sequential method gives better performance
     if hasattr(sgd, "communicator"):
         DIST = True
         sequential = True