Repository: pytorch/tnt

Issue:
PEP8 compliance?
I notice sometimes snake_case, sometimes mixedCase are used for class methods
```python
def on_end_epoch(state):
        mlog.printMeter(mode="Train", iepoch=state['epoch'])
        mlog.resetMeter(mode="Train", iepoch=state['epoch'])
```
WIll tnt codebase 100% comply with PEP8?


Discussion:

Resolving patch:
diff --git a/example/mnist_with_meterlogger.py b/example/mnist_with_meterlogger.py
--- a/example/mnist_with_meterlogger.py
+++ b/example/mnist_with_meterlogger.py
@@ -78,21 +78,21 @@ def on_forward(state):
         output = state['output']
         target = state['sample'][1]
         # online ploter
-        mlog.updateLoss(loss, meter='loss')
-        mlog.updateMeter(output, target, meters={'accuracy', 'map', 'confusion'})
+        mlog.update_loss(loss, meter='loss')
+        mlog.update_meter(output, target, meters={'accuracy', 'map', 'confusion'})
 
     def on_start_epoch(state):
         mlog.timer.reset()
         state['iterator'] = tqdm(state['iterator'])
 
     def on_end_epoch(state):
-        mlog.printMeter(mode="Train", iepoch=state['epoch'])
-        mlog.resetMeter(mode="Train", iepoch=state['epoch'])
+        mlog.print_meter(mode="Train", iepoch=state['epoch'])
+        mlog.reset_meter(mode="Train", iepoch=state['epoch'])
 
         # do validation at the end of each epoch
         engine.test(h, get_iterator(False))
-        mlog.printMeter(mode="Test", iepoch=state['epoch'])
-        mlog.resetMeter(mode="Test", iepoch=state['epoch'])
+        mlog.print_meter(mode="Test", iepoch=state['epoch'])
+        mlog.reset_meter(mode="Test", iepoch=state['epoch'])
 
     engine.hooks['on_sample'] = on_sample
     engine.hooks['on_forward'] = on_forward
diff --git a/torchnet/logger/meterlogger.py b/torchnet/logger/meterlogger.py
--- a/torchnet/logger/meterlogger.py
+++ b/torchnet/logger/meterlogger.py
@@ -22,13 +22,13 @@ def __init__(self, server="http://localhost", port=8097, nclass=21, title="DNN")
         self.logger = {'Train': {}, 'Test': {}}
         self.timer = tnt.meter.TimeMeter(None)
 
-    def __ver2Tensor(self, target):
+    def _ver2tensor(self, target):
         target_mat = torch.zeros(target.shape[0], self.nclass)
         for i, j in enumerate(target):
             target_mat[i][j] = 1
         return target_mat
 
-    def __toTensor(self, var):
+    def __to_tensor(self, var):
         if isinstance(var, torch.autograd.Variable):
             var = var.data
         if not torch.is_tensor(var):
@@ -66,25 +66,25 @@ def __addmeter(self, meter):
             self.meter[meter] = tnt.meter.ConfusionMeter(self.nclass, normalized=True)
             self.__addlogger(meter, 'heatmap')
 
-    def updateMeter(self, output, target, meters={'accuracy'}):
-        output = self.__toTensor(output)
-        target = self.__toTensor(target)
+    def update_meter(self, output, target, meters={'accuracy'}):
+        output = self.__to_tensor(output)
+        target = self.__to_tensor(target)
         for meter in meters:
             if meter not in self.meter.keys():
                 self.__addmeter(meter)
             if meter in ['ap', 'map', 'confusion']:
-                target_th = self.__ver2Tensor(target)
+                target_th = self._ver2tensor(target)
                 self.meter[meter].add(output, target_th)
             else:
                 self.meter[meter].add(output, target)
 
-    def updateLoss(self, loss, meter='loss'):
-        loss = self.__toTensor(loss)
+    def update_loss(self, loss, meter='loss'):
+        loss = self.__to_tensor(loss)
         if meter not in self.meter.keys():
             self.__addloss(meter)
         self.meter[meter].add(loss[0])
 
-    def resetMeter(self, iepoch, mode='Train'):
+    def reset_meter(self, iepoch, mode='Train'):
         self.timer.reset()
         for key in self.meter.keys():
             val = self.meter[key].value()
@@ -95,7 +95,7 @@ def resetMeter(self, iepoch, mode='Train'):
                 self.logger[mode][key].log(iepoch, val)
             self.meter[key].reset()
 
-    def printMeter(self, mode, iepoch, ibatch=1, totalbatch=1, meterlist=None):
+    def print_meter(self, mode, iepoch, ibatch=1, totalbatch=1, meterlist=None):
         pstr = "%s:\t[%d][%d/%d] \t"
         tval = []
         tval.extend([mode, iepoch, ibatch, totalbatch])


Test patch: