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 — DeepLearning/python/utils.py at master · cdingding/DeepLearning Expand file tree/ Copy pathutils.pyMore file actions executable file ·40 lines (25 loc) · 731 Bytes / Copy pathutils.pyFile metadata and controlsexecutable file ·40 lines (25 loc) · 731 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 34 35 36 37 38 39 import numpy numpy.seterr(all='ignore') def sigmoid(x): return 1. / (1 + numpy.exp(-x)) def dsigmoid(x): return x * (1. - x) def tanh(x): return numpy.tanh(x) def dtanh(x): return 1. - x * x def softmax(x): e = numpy.exp(x - numpy.max(x)) # prevent overflow if e.ndim == 1: return e / numpy.sum(e, axis=0) else: return e / numpy.array([numpy.sum(e, axis=1)]).T # ndim = 2 def ReLU(x): return x * (x > 0) def dReLU(x): return 1. * (x > 0) # # probability density for the Gaussian dist # def gaussian(x, mean=0.0, scale=1.0): # s = 2 * numpy.power(scale, 2) # e = numpy.exp( - numpy.power((x - mean), 2) / s ) # return e / numpy.square(numpy.pi * s) |
| You are visitor 01402520 — 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. |