GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — softpool/utils.py at master · wangyida/softpool Expand file tree/ Copy pathutils.pyMore file actions 33 lines (26 loc) · 867 Bytes / Copy pathutils.pyFile metadata and controls33 lines (26 loc) · 867 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 import os import random import numpy as np #initialize the weighs of the network for Convolutional layers and batchnorm layers def weights_init(m): classname = m.__class__.__name__ if classname.find('Conv') != -1 and classname.find('Conv2d') == -1: m.weight.data.normal_(0.0, 0.02) elif classname.find('BatchNorm') != -1 and classname.find( 'BatchNorm2d') == -1: m.weight.data.normal_(1.0, 0.02) m.bias.data.fill_(0) class AverageValueMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val = 0 self.avg = 0 self.sum = 0 self.count = 0.0 def update(self, val, n=1): self.val = val self.sum += val * n self.count += n self.avg = self.sum / self.count |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |