예제 #1
0
파일: enwiki.py 프로젝트: lipengyu/cle
    Picklize
)
from cle.cle.train.opt import Adam
from cle.cle.utils import flatten, sharedX, unpack, OrderedDict
from cle.datasets.enwiki import EnWiki


data_path = '/home/junyoung/data/wikipedia-text/enwiki_char_and_word.npz'
save_path = '/home/junyoung/repos/cle/saved/'

batch_size = 100
reset_freq = 100
debug = 0

model = Model()
trdata = EnWiki(name='train',
                path=data_path)
tedata = EnWiki(name='test',
                path=data_path)

init_W = InitCell('rand')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

x, y = trdata.theano_vars()
if debug:
    x.tag.test_value = np.zeros((10, batch_size, 1), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, 1), dtype=np.float32)

onehot = OnehotLayer(name='onehot',
                     parent=['x'],
                     nout=205)
예제 #2
0
파일: enwiki.py 프로젝트: Beronx86/cle
    Monitoring,
    Picklize
)
from cle.cle.train.opt import Adam
from cle.cle.utils import flatten, sharedX, unpack, OrderedDict
from cle.datasets.enwiki import EnWiki

data_path = '/home/junyoung/data/wikipedia-text/enwiki_char_and_word.npz'
save_path = '/home/junyoung/src/cle/saved/'

batch_size = 100
reset_freq = 100
debug = 0

model = Model()
train_data = EnWiki(name='train',
                    path=data_path)

test_data = EnWiki(name='test',
                   path=data_path)

init_W = InitCell('rand')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

x, y = train_data.theano_vars()
if debug:
    x.tag.test_value = np.zeros((10, batch_size, 1), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, 1), dtype=np.float32)

h1 = GFLSTM(name='h1',
            parent=['x'],
예제 #3
0
파일: enwiki.py 프로젝트: vishalbelsare/cle
from cle.cle.train import Training
from cle.cle.train.ext import (EpochCount, GradientClipping, Monitoring,
                               Picklize)
from cle.cle.train.opt import Adam
from cle.cle.utils import flatten, sharedX, unpack, OrderedDict
from cle.datasets.enwiki import EnWiki

data_path = '/home/junyoung/data/wikipedia-text/enwiki_char_and_word.npz'
save_path = '/home/junyoung/src/cle/saved/'

batch_size = 100
reset_freq = 100
debug = 0

model = Model()
train_data = EnWiki(name='train', path=data_path)

test_data = EnWiki(name='test', path=data_path)

init_W = InitCell('rand')
init_U = InitCell('ortho')
init_b = InitCell('zeros')

x, y = train_data.theano_vars()
if debug:
    x.tag.test_value = np.zeros((10, batch_size, 1), dtype=np.float32)
    y.tag.test_value = np.zeros((10, batch_size, 1), dtype=np.float32)

h1 = GFLSTM(name='h1',
            parent=['x'],
            parent_dim=[205],