Skip to content

Instantly share code, notes, and snippets.

class SoftmaxLayer(CostLayer):
"""
Softmax output layer.
"""
def _get_samples(self, model, length=30, temp=1, *inps):
"""
See parent class
"""
if not hasattr(model, 'word_indxs_src'):
class RNNEncoderDecoder(object):
"""This class encapsulates the translation model.
hack
The expected usage pattern is:
>>> encdec = RNNEncoderDecoder(...)
>>> encdec.build(...)
>>> useful_smth = encdec.create_useful_smth(...)
Functions from the create_smth family (except create_lm_model)
when called complile and return functions that do useful stuff.
class Decoder(EncoderDecoderBase):
EVALUATION = 0
SAMPLING = 1
BEAM_SEARCH = 2
def __init__(self, state, rng, prefix='dec',
skip_init=False, compute_alignment=False):
self.state = state
self.rng = rng
INFO:deepy.trainers.trainers:valid (iter=0) J=6.05 *
> 14% ITER COST:5.615.58
> 25%INFO:deepy.networks.network:saving parameters to /mnt/nmt/models/lstm_2lay_v10k10k_1024h_trun40_lr0.7.gz
INFO:deepy.utils.train_logger:Save training log to /mnt/nmt/models/lstm_2lay_v10k10k_1024h_trun40_lr0.7.log
INFO:deepy.trainers.trainers:valid (iter=0) J=5.95 *
> 38%INFO:deepy.networks.network:saving parameters to /mnt/nmt/models/lstm_2lay_v10k10k_1024h_trun40_lr0.7.gz
INFO:deepy.utils.train_logger:Save training log to /mnt/nmt/models/lstm_2lay_v10k10k_1024h_trun40_lr0.7.log
INFO:deepy.trainers.trainers:valid (iter=0) J=5.93 *
@zomux
zomux / buf.txt
Last active August 29, 2015 14:25 — forked from anonymous/buf.txt
Function profiling
==================
Message: /home/ubuntu/deepy/deepy/trainers/trainers.py:73
Time in 16 calls to Function.__call__: 9.254583e+00s
Time in Function.fn.__call__: 9.252455e+00s (99.977%)
Time in thunks: 9.208560e+00s (99.503%)
Total compile time: 1.111225e+01s
Number of Apply nodes: 344
Theano Optimizer time: 9.731210e+00s
CUDA_LAUNCH_BLOCKING=1 python ./trails/lstm_encdec/train.py /home/ubuntu/data/pickles/remt1.v80k_40k.unkpos.b80.trun40.rev.pack --valid /home/ubuntu/data/pickles/remt1.v80k_40k.unkpos.b80.trun40.rev.valid.pack --source_size 80000 --target_size 40001 --hidden_size 1536 --approx --word_embed 1000 --arch one_layer_search --encoder_mask --save /home/ubuntu/data/models/irnn_sch_1lay_v80k40k_1536h_trun40_emb_msk_pred_adadelta.gz --optimizer adadelta --lr 0.01 --train_size 12500 --predict
> 11%INFO:deepy.trainers.trainers:valid (iter=0) J=19.31
> 18%^ZTER COST:33.15
#!/bin/sh
MAIL_BIN="/usr/sbin/sendmail"
MAIL_FROM="[email protected]"
MAIL_ADDR="[email protected]"
report() {
CMD="curl http://169.254.169.254/latest/meta-data/public-ipv4"
ip=`$CMD`
echo $ip > /tmp/new_aws_machine_ip_.txt
@zomux
zomux / Length model
Last active August 29, 2015 14:25
WAT EXP
CUDA_LAUNCH_BLOCKING=1 python ./trails/length_model/train.py /home/ubuntu/data/pickles/remt1.v80k_40k.unkpos.b80.trun40.rev.pack --valid /home/ubuntu/data/pickles/remt1.v80k_40k.unkpos.b80.trun40.rev.valid.pack --source_size 80000 --hidden_size 512 --word_embed 500 --arch lstm_one_layer --encoder_mask --save /home/ubuntu/data/models/length_model_lstm_1lay_v80k40k_512h_trun40_emb_msk_adadelta.uncompressed.npz --optimizer adadelta --lr 0.01 --train_size 12500