コード例 #1
0
ファイル: model.py プロジェクト: rhythm92/wavenet
    params = Params()
    params.audio_channels = 256

    params.causal_conv_no_bias = True
    params.causal_conv_kernel_width = 2
    params.causal_conv_channels = [128]

    params.residual_conv_dilation_no_bias = True
    params.residual_conv_projection_no_bias = True
    params.residual_conv_kernel_width = 2
    params.residual_conv_channels = [32, 32, 32, 32, 32, 32, 32, 32, 32]
    params.residual_num_blocks = 5

    params.softmax_conv_no_bias = True
    params.softmax_conv_kernel_width = 2
    params.softmax_conv_channels = [128, 256]

    params.learning_rate = 0.1
    params.gradient_momentum = 0.9
    params.weight_decay = 0.000001
    params.gradient_clipping = 10.0

    params.gpu_enabled = True if args.gpu_enabled == 1 else False

    if args.use_faster_wavenet:
        wavenet = FasterWaveNet(params)
    else:
        wavenet = WaveNet(params)

    with open(filename, "w") as f:
        json.dump(params.to_dict(), f, indent=4)
コード例 #2
0
ファイル: model.py プロジェクト: soroushmehr/wavenet-1
else:
    params = Params()
    params.quantization_steps = 10

    params.causal_conv_no_bias = True
    params.causal_conv_filter_width = 3
    params.causal_conv_channels = [32]

    params.residual_conv_dilation_no_bias = True
    params.residual_conv_projection_no_bias = True
    params.residual_conv_filter_width = 3
    params.residual_conv_channels = [16, 16]
    params.residual_num_blocks = 1

    params.softmax_conv_no_bias = False
    params.softmax_conv_channels = [24, 10]

    params.optimizer = "eve"
    params.learning_rate = 0.001
    params.momentum = 0.9
    params.weight_decay = 0.00001
    params.gradient_clipping = 10.0

    wavenet = WaveNet(params)
    f = open(filename, "w")
    json.dump(params.to_dict(), open(filename, "w"), indent=4)

params.dump()
wavenet.load(args.model_dir)

if args.gpu_device != -1:
コード例 #3
0
    params = Params(dict)
    wavenet = WaveNet(params)
else:
    params = Params()
    params.quantization_steps = 6

    params.causal_conv_no_bias = True
    params.causal_conv_filter_width = 2
    params.causal_conv_channels = [4]

    params.residual_conv_dilation_no_bias = True
    params.residual_conv_projection_no_bias = True
    params.residual_conv_filter_width = 2
    params.residual_conv_channels = [3, 3]
    params.residual_num_blocks = 1

    params.softmax_conv_no_bias = False
    params.softmax_conv_channels = [4, 6]

    params.learning_rate = 0.1
    params.gradient_momentum = 0.9
    params.weight_decay = 0.00001
    params.gradient_clipping = 10.0

    wavenet = WaveNet(params)
    f = open(filename, "w")
    json.dump(params.to_dict(), f, indent=4)

params.gpu_enabled = True if args.gpu_enabled == 1 else False
params.dump()
wavenet.load(args.model_dir)
コード例 #4
0
    params.sampling_rate = 8000

    params.causal_conv_no_bias = True
    params.causal_conv_filter_width = 2
    params.causal_conv_channels = [256]

    params.residual_conv_dilation_no_bias = True
    params.residual_conv_projection_no_bias = True
    params.residual_conv_filter_width = 2
    params.residual_conv_channels = [
        128, 128, 128, 128, 128, 128, 128, 128, 128, 128
    ]
    params.residual_num_blocks = 1

    params.softmax_conv_no_bias = False
    params.softmax_conv_channels = [256, 256]

    params.optimizer = "adam"
    params.momentum = 0.9
    params.weight_decay = 0
    params.gradient_clipping = 1.0

    with open(filename, "w") as f:
        json.dump(params.to_dict(), f, indent=4)

if args.fast:
    wavenet = FasterWaveNet(params)
else:
    wavenet = WaveNet(params)

params.dump()