Example #1
0
import cPickle
import logging

from blocks.serialization import load as load_parameters
from blocks.model import Model

from datasets import parrot_stream
from model import Parrot
from utils import (attention_plot, sample_parse, create_animation,
                   numpy_one_hot)
from generate import generate_wav

logging.basicConfig()

data_dir = os.environ['FUEL_DATA_PATH']
args = sample_parse()

with open(os.path.join(args.save_dir, 'config',
                       args.experiment_name + '.pkl')) as f:
    saved_args = cPickle.load(f)

assert saved_args.dataset == args.dataset

if args.use_last:
    params_mode = 'last_'
else:
    params_mode = 'best_'

args.samples_name = params_mode + args.samples_name

with open(
Example #2
0
"""

import numpy
import os
import cPickle
import logging

from blocks.serialization import load_parameters
from blocks.model import Model
from model import Scribe
from theano import function
from utils import char2code, sample_parse, full_plot

logging.basicConfig()

parser = sample_parse()
args = parser.parse_args()

with open(os.path.join(args.save_dir, 'config',
                       args.experiment_name + '.pkl')) as f:
    saved_args = cPickle.load(f)

with open(
        os.path.join(args.save_dir, "pkl",
                     "best_" + args.experiment_name + ".tar"), 'rb') as src:
    parameters = load_parameters(src)

scribe = Scribe(k=saved_args.num_mixture,
                rec_h_dim=saved_args.rnn_size,
                att_size=saved_args.size_attention,
                num_letters=saved_args.num_letters,