Ejemplo n.º 1
0
def get_arguments():
    parser = argparse.ArgumentParser(description='WaveNet example network')
    parser.add_argument('--batch_size', type=int, default=BATCH_SIZE,
                        help='How many wav files to process at once.')
    parser.add_argument('--data_dir', type=str, default=DATA_DIRECTORY,
                        help='The directory containing the VCTK corpus.')
    parser.add_argument('--store_metadata', type=bool, default=False,
                        help='Whether to store advanced debugging information '
                        '(execution time, memory consumption) for use with '
                        'TensorBoard.')
    parser.add_argument('--logdir', type=str, default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root', type=str, default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from', type=str, default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--checkpoint_every', type=int, default=CHECKPOINT_EVERY,
                        help='How many steps to save each checkpoint after')
    parser.add_argument('--num_steps', type=int, default=NUM_STEPS,
                        help='Number of training steps.')
    parser.add_argument('--learning_rate', type=float, default=LEARNING_RATE,
                        help='Learning rate for training.')
    parser.add_argument('--wavenet_params', type=str, default=WAVENET_PARAMS,
                        help='JSON file with the network parameters.')
    parser.add_argument('--sample_size', type=int, default=SAMPLE_SIZE,
                        help='Concatenate and cut audio samples to this many '
                        'samples.')
    parser.add_argument('--l2_regularization_strength', type=float,
                        default=L2_REGULARIZATION_STRENGTH,
                        help='Coefficient in the L2 regularization. '
                        'Disabled by default')
    parser.add_argument('--silence_threshold', type=float,
                        default=SILENCE_THRESHOLD,
                        help='Volume threshold below which to trim the start '
                        'and the end from the training set samples.')
    parser.add_argument('--optimizer', type=str, default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option.')
    parser.add_argument('--momentum', type=float,
                        default=MOMENTUM, help='Specify the momentum to be '
                        'used by sgd or rmsprop optimizer. Ignored by the '
                        'adam optimizer.')
    return parser.parse_args()
Ejemplo n.º 2
0
def get_arguments():
    def _str_to_bool(s):
        """Convert string to bool (in argparse context)."""
        if s.lower() not in ['true', 'false']:
            raise ValueError('Argument needs to be a '
                             'boolean, got {}'.format(s))
        return {'true': True, 'false': False}[s.lower()]

    parser = argparse.ArgumentParser(description='WaveNet example network')
    parser.add_argument(
        '--batch_size',
        type=int,
        default=BATCH_SIZE,
        help='How many wav files to process at once. Default: ' +
        str(BATCH_SIZE) + '.')
    parser.add_argument('--data_dir',
                        type=str,
                        default=DATA_DIRECTORY,
                        help='The directory containing the VCTK corpus.')
    parser.add_argument('--store_metadata',
                        type=bool,
                        default=METADATA,
                        help='Whether to store advanced debugging information '
                        '(execution time, memory consumption) for use with '
                        'TensorBoard. Default: ' + str(METADATA) + '.')
    parser.add_argument('--logdir',
                        type=str,
                        default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root',
                        type=str,
                        default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from',
                        type=str,
                        default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument(
        '--checkpoint_every',
        type=int,
        default=CHECKPOINT_EVERY,
        help='How many steps to save each checkpoint after. Default: ' +
        str(CHECKPOINT_EVERY) + '.')
    parser.add_argument('--num_steps',
                        type=int,
                        default=NUM_STEPS,
                        help='Number of training steps. Default: ' +
                        str(NUM_STEPS) + '.')
    parser.add_argument('--learning_rate',
                        type=float,
                        default=LEARNING_RATE,
                        help='Learning rate for training. Default: ' +
                        str(LEARNING_RATE) + '.')
    parser.add_argument(
        '--wavenet_params',
        type=str,
        default=WAVENET_PARAMS,
        help='JSON file with the network parameters. Default: ' +
        WAVENET_PARAMS + '.')
    parser.add_argument('--sample_size',
                        type=int,
                        default=SAMPLE_SIZE,
                        help='Concatenate and cut audio samples to this many '
                        'samples. Default: ' + str(SAMPLE_SIZE) + '.')
    parser.add_argument('--l2_regularization_strength',
                        type=float,
                        default=L2_REGULARIZATION_STRENGTH,
                        help='Coefficient in the L2 regularization. '
                        'Default: False')
    parser.add_argument(
        '--silence_threshold',
        type=float,
        default=SILENCE_THRESHOLD,
        help='Volume threshold below which to trim the start '
        'and the end from the training set samples. Default: ' +
        str(SILENCE_THRESHOLD) + '.')
    parser.add_argument(
        '--optimizer',
        type=str,
        default='adam',
        choices=optimizer_factory.keys(),
        help='Select the optimizer specified by this option. Default: adam.')
    parser.add_argument('--momentum',
                        type=float,
                        default=MOMENTUM,
                        help='Specify the momentum to be '
                        'used by sgd or rmsprop optimizer. Ignored by the '
                        'adam optimizer. Default: ' + str(MOMENTUM) + '.')
    parser.add_argument(
        '--histograms',
        type=_str_to_bool,
        default=False,
        help='Whether to store histogram summaries. Default: False')
    parser.add_argument(
        '--gc_channels',
        type=int,
        default=None,
        help=
        'Number of global condition channels. Default: None. Expecting: Int')
    parser.add_argument(
        '--max_checkpoints',
        type=int,
        default=MAX_TO_KEEP,
        help='Maximum amount of checkpoints that will be kept alive. Default: '
        + str(MAX_TO_KEEP) + '.')
    return parser.parse_args()
Ejemplo n.º 3
0
def get_arguments():
    def _str_to_bool(s):
        """Convert string to bool (in argparse context)."""
        if s.lower() not in ['true', 'false']:
            raise ValueError('Argument needs to be a '
                             'boolean, got {}'.format(s))
        return {'true': True, 'false': False}[s.lower()]

    parser = argparse.ArgumentParser(description='WaveNet example network')
    parser.add_argument('--batch_size', type=int, default=BATCH_SIZE,
                        help='How many wav files to process at once. Default: ' + str(BATCH_SIZE) + '.')
    parser.add_argument('--data_set', type=str, default=DATA_SET,
                        help='String id for Nottingham or JSB_Chorales.')
    parser.add_argument('--store_metadata', type=bool, default=METADATA,
                        help='Whether to store advanced debugging information '
                        '(execution time, memory consumption) for use with '
                        'TensorBoard. Default: ' + str(METADATA) + '.')
    parser.add_argument('--logdir', type=str, default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root', type=str, default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from', type=str, default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--checkpoint_every', type=int,
                        default=CHECKPOINT_EVERY,
                        help='How many steps to save each checkpoint after. Default: ' + str(CHECKPOINT_EVERY) + '.')
    parser.add_argument('--num_steps', type=int, default=NUM_STEPS,
                        help='Number of training steps. Default: ' + str(NUM_STEPS) + '.')
    parser.add_argument('--learning_rate', type=float, default=LEARNING_RATE,
                        help='Learning rate for training. Default: ' + str(LEARNING_RATE) + '.')
    parser.add_argument('--sample_size', type=int, default=SAMPLE_SIZE,
                        help='Concatenate and cut audio samples to this many '
                        'samples. Default: ' + str(SAMPLE_SIZE) + '.')
    parser.add_argument('--max_dilation_pow', type=int, default=MAX_DILATION_POW,
                        help='Maximum dilation of causal convolutional filter'
                        'max_dilation_pow. Default: ' + str(MAX_DILATION_POW) + '.')
    parser.add_argument('--dil_chan', type=int, default=DIL_CHAN,
                        help='Number of dilation channels'
                        'dil_chan. Default: ' + str(DIL_CHAN) + '.')
    parser.add_argument('--res_chan', type=int, default=RES_CHAN,
                        help='Number of residual channels'
                        'res_chan. Default: ' + str(RES_CHAN) + '.')
    parser.add_argument('--skip_chan', type=int, default=SKIP_CHAN,
                        help='Number of skip channels'
                        'skip_chan. Default: ' + str(SKIP_CHAN) + '.')
    parser.add_argument('--expansion_reps', type=int, default=EXPANSION_REPS,
                        help='How many times to repeat dilated causal convolutional expansion'
                        'expansion_reps. Default: ' + str(EXPANSION_REPS) + '.')
    parser.add_argument('--l2_regularization_strength', type=float,
                        default=L2_REGULARIZATION_STRENGTH,
                        help='Coefficient in the L2 regularization. '
                        'Default: False')
    parser.add_argument('--optimizer', type=str, default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option. Default: adam.')
    parser.add_argument('--momentum', type=float,
                        default=MOMENTUM, help='Specify the momentum to be '
                        'used by sgd or rmsprop optimizer. Ignored by the '
                        'adam optimizer. Default: ' + str(MOMENTUM) + '.')
    parser.add_argument('--histograms', type=_str_to_bool, default=False,
                        help='Whether to store histogram summaries. Default: False')
    parser.add_argument('--gc_channels', type=int, default=None,
                        help='Number of global condition channels. Default: None. Expecting: Int')
    parser.add_argument('--max_checkpoints', type=int, default=MAX_TO_KEEP,
                        help='Maximum amount of checkpoints that will be kept alive. Default: '
                             + str(MAX_TO_KEEP) + '.')
    return parser.parse_args()
Ejemplo n.º 4
0
                        type=float,
                        default=0.003,
                        help='Learning rate for SGD')

    # WAVENET.PY
    parser.add_argument('--sample_size',
                        type=int,
                        default=1000,
                        help='Concatenate and cut audio samples to this many '
                        'samples. Default: 1000')
    parser.add_argument('--l2_regularization_strength', type=float,
                        default=0,
                        help='Coefficient in the L2 regularization. '
                        'Default: False')
    parser.add_argument('--optimizer', type=str, default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option. Default: adam.')
    parser.add_argument('--momentum', type=float,
                        default=0.9, help='Specify the momentum to be '
                        'used by sgd or rmsprop optimizer. Ignored by the '
                        'adam optimizer. Default: 0.9.')

    parser.add_argument('--reader_config', type=str,
                        default="reader_config.json", help='Specify the path to the config file.')

    # Wavenet Params
    parser.add_argument('--filter_width',
                        type=int,
                        default=8,
                        help='Part of Wavenet Params')
    parser.add_argument('--dilations',
Ejemplo n.º 5
0
def get_arguments():
    def _str_to_bool(s):
        '''Convert string to bool (in argparse context).'''
        if s.lower() not in ['true', 'false']:
            raise ValueError('Argument needs to be a '
                             'boolean, got {}'.format(s))
        return {'true': True, 'false': False}[s.lower()]

    parser = argparse.ArgumentParser(description='WaveNet for Transcription '
                                     '- training')

    parser.add_argument('--batch_size',
                        type=int,
                        default=BATCH_SIZE,
                        help='How many batch samples to process at once. '
                        'Default: ' + str(BATCH_SIZE) + '.')
    parser.add_argument('--data_dir_train',
                        type=str,
                        default=DATA_DIRECTORY_TRAIN,
                        help='The directory '
                        'containing the training data files. '
                        'Default: ' + DATA_DIRECTORY_TRAIN + '.')
    parser.add_argument('--data_dir_valid',
                        type=str,
                        default=DATA_DIRECTORY_VALID,
                        help='The directory '
                        'containing the validation data files. '
                        'Default: ' + DATA_DIRECTORY_VALID + '.')
    parser.add_argument('--logdir',
                        type=str,
                        default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root',
                        type=str,
                        default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from',
                        type=str,
                        default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')

    parser.add_argument(
        '--model_params',
        type=str,
        default=MODEL_PARAMS,
        help='JSON file with the architecture hyperparameters. '
        'Default: ' + MODEL_PARAMS + '.')
    parser.add_argument('--training_params',
                        type=str,
                        default=TRAINING_PARAMS,
                        help='JSON file with some training hyperparameters. '
                        'Default: ' + TRAINING_PARAMS + '.')
    parser.add_argument('--sample_size',
                        type=int,
                        default=SAMPLE_SIZE,
                        help='Concatenate and cut audio samples to this many '
                        'samples. Default: ' + str(SAMPLE_SIZE) + '.')
    parser.add_argument('--optimizer',
                        type=str,
                        default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option. '
                        'Default: adam.')

    parser.add_argument('--max_checkpoints',
                        type=int,
                        default=MAX_TO_KEEP,
                        help='Maximum amount of checkpoints that will be '
                        'kept alive. '
                        'Default: ' + str(MAX_TO_KEEP) + '.')
    parser.add_argument('--velocity',
                        type=_str_to_bool,
                        default=VELOCITY,
                        help='Whether to train to estimate velocity of '
                        'present notes. '
                        'Default: ' + str(VELOCITY) + '.')
    parser.add_argument('--threshold',
                        type=float,
                        default=THRESHOLD,
                        help='Threshold for post-processing. '
                        'Default: ' + str(THRESHOLD) + '.')

    return parser.parse_args()
Ejemplo n.º 6
0
def get_arguments():
    def _str_to_bool(s):
        """Convert string to bool (in argparse context)."""
        if s.lower() not in ['true', 'false']:
            raise ValueError('Argument needs to be a '
                             'boolean, got {}'.format(s))
        return {'true': True, 'false': False}[s.lower()]

    parser = argparse.ArgumentParser(description='WaveNet example network')
    parser.add_argument('--batch_size', type=int, default=BATCH_SIZE,
                        help='How many wav files to process at once. Default: ' + str(BATCH_SIZE) + '.')
    parser.add_argument('--data_dir', type=str, default=DATA_DIRECTORY,
                        help='The directory containing the VCTK corpus.')
    parser.add_argument('--store_metadata', type=bool, default=METADATA,
                        help='Whether to store advanced debugging information '
                        '(execution time, memory consumption) for use with '
                        'TensorBoard. Default: ' + str(METADATA) + '.')
    parser.add_argument('--logdir', type=str, default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root', type=str, default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from', type=str, default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--checkpoint_every', type=int,
                        default=CHECKPOINT_EVERY,
                        help='How many steps to save each checkpoint after. Default: ' + str(CHECKPOINT_EVERY) + '.')
    parser.add_argument('--num_steps', type=int, default=NUM_STEPS,
                        help='Number of training steps. Default: ' + str(NUM_STEPS) + '.')
    parser.add_argument('--learning_rate', type=float, default=LEARNING_RATE,
                        help='Learning rate for training. Default: ' + str(LEARNING_RATE) + '.')
    parser.add_argument('--wavenet_params', type=str, default=WAVENET_PARAMS,
                        help='JSON file with the network parameters. Default: ' + WAVENET_PARAMS + '.')
    parser.add_argument('--sample_size', type=int, default=SAMPLE_SIZE,
                        help='Concatenate and cut audio samples to this many '
                        'samples. Default: ' + str(SAMPLE_SIZE) + '.')
    parser.add_argument('--l2_regularization_strength', type=float,
                        default=L2_REGULARIZATION_STRENGTH,
                        help='Coefficient in the L2 regularization. '
                        'Default: False')
    parser.add_argument('--silence_threshold', type=float,
                        default=SILENCE_THRESHOLD,
                        help='Volume threshold below which to trim the start '
                        'and the end from the training set samples. Default: ' + str(SILENCE_THRESHOLD) + '.')
    parser.add_argument('--optimizer', type=str, default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option. Default: adam.')
    parser.add_argument('--momentum', type=float,
                        default=MOMENTUM, help='Specify the momentum to be '
                        'used by sgd or rmsprop optimizer. Ignored by the '
                        'adam optimizer. Default: ' + str(MOMENTUM) + '.')
    parser.add_argument('--histograms', type=_str_to_bool, default=False,
                        help='Whether to store histogram summaries. Default: False')
    parser.add_argument('--gc_channels', type=int, default=None,
                        help='Number of global condition channels. Default: None. Expecting: Int')
    parser.add_argument('--max_checkpoints', type=int, default=MAX_TO_KEEP,
                        help='Maximum amount of checkpoints that will be kept alive. Default: '
                             + str(MAX_TO_KEEP) + '.')
    return parser.parse_args()
Ejemplo n.º 7
0
def get_arguments():
    def _str_to_bool(s):
        '''Convert string to bool (in argparse context).'''
        if s.lower() not in ['true', 'false']:
            raise ValueError('Argument needs to be a '
                             'boolean, got {}'.format(s))
        return {'true': True, 'false': False}[s.lower()]

    parser = argparse.ArgumentParser(description='WaveNet for Transcription '
                                    '- training')

    parser.add_argument('--batch_size', type=int, default=BATCH_SIZE,
                        help='How many batch samples to process at once. '
                        'Default: ' + str(BATCH_SIZE) + '.')
    parser.add_argument('--data_dir_train', type=str,
                        default=DATA_DIRECTORY_TRAIN, help='The directory '
                        'containing the training data files. '
                        'Default: ' + DATA_DIRECTORY_TRAIN + '.')
    parser.add_argument('--data_dir_valid', type=str,
                        default=DATA_DIRECTORY_VALID, help='The directory '
                        'containing the validation data files. '
                        'Default: ' + DATA_DIRECTORY_VALID + '.')
    parser.add_argument('--logdir', type=str, default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root', type=str, default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from', type=str, default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')

    parser.add_argument('--model_params', type=str, default=MODEL_PARAMS,
                        help='JSON file with the architecture hyperparameters. '
                        'Default: ' + MODEL_PARAMS + '.')
    parser.add_argument('--training_params', type=str, default=TRAINING_PARAMS,
                        help='JSON file with some training hyperparameters. '
                        'Default: ' + TRAINING_PARAMS + '.')
    parser.add_argument('--sample_size', type=int, default=SAMPLE_SIZE,
                        help='Concatenate and cut audio samples to this many '
                        'samples. Default: ' + str(SAMPLE_SIZE) + '.')
    parser.add_argument('--optimizer', type=str, default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option. '
                        'Default: adam.')

    parser.add_argument('--max_checkpoints', type=int, default=MAX_TO_KEEP,
                        help='Maximum amount of checkpoints that will be '
                        'kept alive. '
                        'Default: ' + str(MAX_TO_KEEP) + '.')
    parser.add_argument('--velocity', type=_str_to_bool, default=VELOCITY,
                        help='Whether to train to estimate velocity of '
                        'present notes. '
                        'Default: ' + str(VELOCITY) + '.')
    parser.add_argument('--threshold', type=float, default=THRESHOLD,
                        help='Threshold for post-processing. '
                        'Default: ' + str(THRESHOLD) + '.')

    return parser.parse_args()
Ejemplo n.º 8
0
def get_arguments():
    parser = argparse.ArgumentParser(description='WaveNet example network')
    parser.add_argument(
        '--batch_size',
        type=int,
        default=BATCH_SIZE,
        help='How many wav files to process at once. Default: ' +
        str(BATCH_SIZE) + '.')
    parser.add_argument('--data_dir',
                        type=str,
                        default=DATA_DIRECTORY,
                        help='The directory containing the training corpus.')
    parser.add_argument('--logdir',
                        type=str,
                        default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root',
                        type=str,
                        default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from',
                        type=str,
                        default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--checkpoint_every',
                        type=int,
                        default=CHECKPOINT_EVERY,
                        help='How many steps to save each checkpoint after. '
                        'Default: ' + str(CHECKPOINT_EVERY) + '.')
    parser.add_argument('--num_steps',
                        type=int,
                        default=NUM_STEPS,
                        help='Number of training steps. Default: ' +
                        str(NUM_STEPS) + '.')
    parser.add_argument(
        '--wavenet_params',
        type=str,
        default=WAVENET_PARAMS,
        help='JSON file with the network parameters. Default: ' +
        WAVENET_PARAMS + '.')
    parser.add_argument('--optimizer',
                        type=str,
                        default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option. '
                        'Default: adam.')
    parser.add_argument('--momentum',
                        type=float,
                        default=MOMENTUM,
                        help='Specify the momentum to be '
                        'used by sgd or rmsprop optimizer. Ignored by the '
                        'adam optimizer. Default: ' + str(MOMENTUM) + '.')
    parser.add_argument('--gc_channels',
                        type=int,
                        default=None,
                        help='Number of global condition channels. '
                        'Default: None. Expecting: Int')
    parser.add_argument('--lc_channels',
                        type=int,
                        default=None,
                        help='Number of local condition channels. '
                        'Default: None. Expecting: Int')
    return parser.parse_args()
Ejemplo n.º 9
0
def get_arguments():
    def _str_to_bool(s):
        """Convert string to bool (in argparse context)."""
        if s.lower() not in ['true', 'false']:
            raise ValueError('Argument needs to be a '
                             'boolean, got {}'.format(s))
        return {'true': True, 'false': False}[s.lower()]

    parser = argparse.ArgumentParser(description='WaveNet example network')
    parser.add_argument('--batch_size',
                        type=int,
                        default=BATCH_SIZE,
                        help='How many wav files to process at once.')
    parser.add_argument(
        '--file_list',
        type=str,
        default=FILE_LIST,
        help=
        'The list that contains the base names of the training audio and label files.'
    )
    parser.add_argument('--audio_dir',
                        type=str,
                        default=DATA_DIRECTORY + 'wav/',
                        help='The directory containing the audio samples.')
    parser.add_argument(
        '--label_dir',
        type=str,
        default=DATA_DIRECTORY + 'binary_label_norm/',
        help='The directory containing the full context labels.')
    parser.add_argument(
        '--label_dim',
        type=int,
        default=LABEL_DIM,
        help=
        'The dimension of the min-max normalized binary full context labels.')
    parser.add_argument('--audio_ext',
                        type=str,
                        default=AUDIO_EXT,
                        help='The extention of the audio filenames.')
    parser.add_argument('--label_ext',
                        type=str,
                        default=LABEL_EXT,
                        help='The extention of the label filenames.')
    parser.add_argument(
        '--frame_shift',
        type=float,
        default=FRAME_SHIFT,
        help='The shift of the window in label files. Usually 0.005 sec')
    parser.add_argument('--store_metadata',
                        type=bool,
                        default=False,
                        help='Whether to store advanced debugging information '
                        '(execution time, memory consumption) for use with '
                        'TensorBoard.')
    parser.add_argument('--logdir',
                        type=str,
                        default=None,
                        help='Directory in which to store the logging '
                        'information for TensorBoard. '
                        'If the model already exists, it will restore '
                        'the state and will continue training. '
                        'Cannot use with --logdir_root and --restore_from.')
    parser.add_argument('--logdir_root',
                        type=str,
                        default=None,
                        help='Root directory to place the logging '
                        'output and generated model. These are stored '
                        'under the dated subdirectory of --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--restore_from',
                        type=str,
                        default=None,
                        help='Directory in which to restore the model from. '
                        'This creates the new model under the dated directory '
                        'in --logdir_root. '
                        'Cannot use with --logdir.')
    parser.add_argument('--checkpoint_every',
                        type=int,
                        default=CHECKPOINT_EVERY,
                        help='How many steps to save each checkpoint after')
    parser.add_argument('--num_steps',
                        type=int,
                        default=NUM_STEPS,
                        help='Number of training steps.')
    parser.add_argument('--learning_rate',
                        type=float,
                        default=LEARNING_RATE,
                        help='Learning rate for training.')
    parser.add_argument('--wavenet_params',
                        type=str,
                        default=WAVENET_PARAMS,
                        help='JSON file with the network parameters.')
    parser.add_argument('--sample_size',
                        type=int,
                        default=SAMPLE_SIZE,
                        help='Concatenate and cut audio samples to this many '
                        'samples.')
    parser.add_argument('--l2_regularization_strength',
                        type=float,
                        default=L2_REGULARIZATION_STRENGTH,
                        help='Coefficient in the L2 regularization. '
                        'Disabled by default')
    parser.add_argument('--silence_threshold',
                        type=float,
                        default=SILENCE_THRESHOLD,
                        help='Volume threshold below which to trim the start '
                        'and the end from the training set samples.')
    parser.add_argument('--optimizer',
                        type=str,
                        default='adam',
                        choices=optimizer_factory.keys(),
                        help='Select the optimizer specified by this option.')
    parser.add_argument('--momentum',
                        type=float,
                        default=MOMENTUM,
                        help='Specify the momentum to be '
                        'used by sgd or rmsprop optimizer. Ignored by the '
                        'adam optimizer.')
    parser.add_argument('--histograms',
                        type=_str_to_bool,
                        default=False,
                        help='Whether to store histogram summaries.')
    return parser.parse_args()