Module audiocraft.grids.magnet.audio_magnet_pretrained_16khz_eval

Evaluation with objective metrics for the pretrained audio-MAGNeT models. This grid takes signature from the training grid and runs evaluation-only stage.

When running the grid for the first time, please use: REGEN=1 dora grid magnet.audio_magnet_pretrained_16khz_eval and re-use the REGEN=1 option when the grid is changed to force regenerating it.

Note that you need the proper metrics external libraries setup to use all the objective metrics activated in this grid. Refer to the README for more information.

Functions

def eval(launcher, batch_size: int = 32)
Expand source code
def eval(launcher, batch_size: int = 32):
    opts = {
        'dset': 'audio/audiocaps_16khz',
        'solver/audiogen/evaluation': 'objective_eval',
        'execute_only': 'evaluate',
        '+dataset.evaluate.batch_size': batch_size,
        '+metrics.fad.tf.batch_size': 32,
    }
    # binary for FAD computation: replace this path with your own path
    metrics_opts = {
        'metrics.fad.tf.bin': '/data/home/jadecopet/local/usr/opt/google-research'
    }

    sub = launcher.bind(opts)
    sub.bind_(metrics_opts)

    # base objective metrics
    sub()