Beispiel #1
0
 def setUp(self):
     try:
         import pydybm.arraymath.dycupy as dycupy
         amath.setup(dycupy)
         print('\ncupy test')
         setup = getattr(super(CupyTestMixin, self), 'setUp', None)
         if setup is not None:
             setup()
     except ImportError:
         print('cupy test skipped')
         self.skipTest(
             'cupy is not installed and tests with cupy are passed')
Beispiel #2
0
 def setUp(self):
     amath.setup(dynumpy)
     print('\nnumpy test')
     setup = getattr(super(NumpyTestMixin, self), 'setUp', None)
     if setup is not None:
         setup()
Beispiel #3
0
            delta = SGD.get_delta()
            SGD.update_with_L1_regularization(variables, delta, L1)
        t += 1

    softerrors = dict()
    prederrors = dict()
    softerrors["lay1"] = softerr1 / (tm1)
    softerrors["lay2"] = softerr2 / (tm1)
    softerrors["laym"] = softerrm / (tm1)
    # prederrors["lay1"] = err1 * 100.0 / (tm1)
    # prederrors["lay2"] = err2 * 100.0 / (tm1)
    prederrors["laym"] = errm * 100.0 / (tm1)
    return prederrors, softerrors, variables


amath.setup(dycupy)
chunkfile = '/home/user01/dev/language-model/chunks256.p'

train1280 = '/home/user01/dev/language-model/train1280.p'
test128 = '/home/user01/dev/language-model/test128.p'

chunklist = pickle.load(open(chunkfile, "rb"))
layerscales = dict()
variables = dict()
inweights = dict()
L2 = dict()
L1 = dict()
steps = dict()
trainchunks = []
testchunks = []
cp.random.seed(481639)