Beispiel #1
0
def main(args):
    device = torch.device('cuda' if args.use_cuda else 'cpu')
    args.sample_rate = {
        '8k':8000,
        '16k':16000,
        '24k':24000,
        '48k':48000,
    }[args.sample_rate]
    model = Model(
        left_context=args.left_context,
        right_context=args.right_context,
        hidden_layers=args.rnn_layers,
        hidden_units=args.rnn_units,
        input_dim=args.input_dim,
        output_dim=args.output_dim,
        kernel_size=args.kernel_size,
        kernel_num=args.kernel_num,
        dropout=args.dropout)
    if not args.log_dir:
        writer = SummaryWriter(os.path.join(args.exp_dir, 'tensorboard'))
    else:
        writer = SummaryWriter(args.log_dir)
    model.to(device)
    if not args.decode:
        train(model, FLAGS, device, writer)
    reload_for_eval(model, FLAGS.exp_dir, FLAGS.use_cuda)
    decode(model, args, device)
def main(args):
    device = torch.device('cuda' if args.use_cuda else 'cpu')
    args.sample_rate = {
        '8k': 8000,
        '16k': 16000,
        '24k': 24000,
        '48k': 48000,
    }[args.sample_rate]
    model = Model(
        rnn_layers=args.rnn_layers,
        rnn_units=args.rnn_units,
        win_len=args.win_len,
        win_inc=args.win_inc,
        fft_len=args.fft_len,
        win_type=args.win_type,
        mode=args.target_mode,
    )
    if not args.log_dir:
        writer = SummaryWriter(os.path.join(args.exp_dir, 'tensorboard'))
    else:
        writer = SummaryWriter(args.log_dir)
    model.to(device)
    if not args.decode:
        train(model, FLAGS, device, writer)
    reload_for_eval(model, FLAGS.exp_dir, FLAGS.use_cuda)
    decode(model, args, device)
Beispiel #3
0
def main(args):
    device = torch.device('cuda' if args.use_cuda else 'cpu')
    args.sample_rate = {
        '8k': 8000,
        '16k': 16000,
        '24k': 24000,
        '48k': 48000,
    }[args.sample_rate]
    model = Model(overallspks=105, )
    if not args.log_dir:
        writer = SummaryWriter(os.path.join(args.exp_dir, 'tensorboard'))
    else:
        writer = SummaryWriter(args.log_dir)
    model.to(device)
    if not args.decode:
        train(model, FLAGS, device, writer)
    reload_for_eval(model, FLAGS.exp_dir, FLAGS.use_cuda)
    decode(model, args, device)