Example #1
0
import os
import sys
import tensorflow as tf
from decode import decode
from train import get_config

# 0 is spanish 1 is english
mode = 0

if __name__ == '__main__':

    enc_vocab_path_Eng = '/Users/smokey/LIGN165_finalproject/final/enc_vocab_English.txt'
    dec_vocab_path_Eng = '/Users/smokey/LIGN165_finalproject/final/dec_vocab_English.txt'

    enc_vocab_path_Sp = '/Users/smokey/LIGN165_finalproject/final/enc_vocab_Spanish.txt'
    dec_vocab_path_Sp = '/Users/smokey/LIGN165_finalproject/final/dec_vocab_Spanish.txt'

    if mode == 0:
        gConfig = get_config('seq2seq_sp.ini')
        decode(enc_vocab_path_Sp, dec_vocab_path_Sp)
    elif mode:
        gConfig = get_config('seq2seq.ini')
        decode(enc_vocab_path_Eng, dec_vocab_path_Eng)
    else:
        # wrong way to execute "serve"
        #   Use : >> python ui/app.py
        #           uses seq2seq_serve.ini as conf file
        print('Serve Usage : >> python ui/app.py')
        print('# uses seq2seq_serve.ini as conf file')
Example #2
0
from train import GenerateExperiment, get_config

config = get_config()
config.seq_length = 30 + 1
config.device = 'cpu'
exp = GenerateExperiment(config=config,
                         name='experiment',
                         n_epochs=1,
                         seed=42,
                         base_dir='./experiment_dir')
exp.run()
Example #3
0
import submitit
from train import run, get_config
import copy
import numpy as np
import time
import os

args = get_config()
args.slurm = True
args.num_epochs = 100

NUM_CONFIG = 25
NUM_SEEDS = 100
partition = "learnfair"
total_time = 24 * 60
NAME = "video_only_2"
PROJECT_NAME = "crocodile"

args.resolution = 128


def run_with_logger(args):
    from logger import ExpvizLogger
    log_dir = os.path.join(
        args.output_path,
        "exp_%i_%i/" % (int(time.time()), np.random.randint(9999)))
    logger = ExpvizLogger(projectname=PROJECT_NAME,
                          hyperparams=args,
                          log_dir=log_dir,
                          expname=NAME)
    run(args, logger)