Exemple #1
0
                print(t, ':', t_var.shape)
            elif isinstance(t_var, (list, dict, tuple, str)):
                print(t, ':', len(t_var))
            if value:
                print(t_var)
        else:
            pass

    min_depth = 3
    max_depth = stgs.VAE_HPARAMS['max_depth']  # maximum network depth

    print(f'Using maximum sequence length of {stgs.VAE_HPARAMS["max_len"]}.')
    torch.cuda.empty_cache()
    vae = NA_VAE(stgs.VAE_HPARAMS)
    vae = vae.float()
    vae = vae.cuda()
    # vae.load_state_dict(torch.load(f'{checkpoint_path}/weights.pt'))

    torch.cuda.empty_cache()
    version = datetime.strftime(datetime.fromtimestamp(seed),
                                '%Y-%m-%d..%H.%M.%S')
    logger = TensorBoardLogger(checkpoint_path, version=version)
    checkpoint = ModelCheckpoint(filepath=checkpoint_path,
                                 save_top_k=1,
                                 verbose=True,
                                 monitor='loss',
                                 mode='min')
    early_stop = EarlyStopping(
        monitor='loss',
        patience=stgs.VAE_HPARAMS['early_stop_patience'],
        verbose=True,
            if isinstance(t_var, (torch.Tensor, np.ndarray)):
                print(t, ':', t_var.shape)
            elif isinstance(t_var, (list, dict, tuple, str)):
                print(t, ':', len(t_var))
            if value:
                print(t_var)
        else:
            pass

    min_depth = 3
    max_depth = stgs.VAE_HPARAMS['max_depth']  # maximum network depth

    print(f'Using maximum sequence length of {stgs.VAE_HPARAMS["max_len"]}.')
    torch.cuda.empty_cache()
    vae = NA_VAE(stgs.VAE_HPARAMS)
    vae.cuda()
    vae = vae.float()
    # vae.load_state_dict(torch.load(f'{checkpoint_path}/weights.pt'))

    torch.cuda.empty_cache()
    version = datetime.strftime(datetime.fromtimestamp(seed), '%Y-%m-%d..%H.%M.%S')
    logger = TensorBoardLogger(checkpoint_path, version=version)
    checkpoint = ModelCheckpoint(
        filepath = checkpoint_path,
        save_top_k=1,
        verbose = True,
        monitor = 'loss',
        mode = 'min')
    early_stop = EarlyStopping(
        monitor = 'loss',
        patience = stgs.VAE_HPARAMS['early_stop_patience'],