Exemple #1
0
import matplotlib.pyplot as plt
from copy import deepcopy
from gantools import blocks
from audioinpainting.load import load_audio_dataset
from audioinpainting.model_basic import InpaintingGAN

# # Parameters

downscale = 2

# # Data handling
# Load the data
start = time.time()
# dataset = data.load.load_audio_dataset(scaling=downscale)
dataset = load_audio_dataset(scaling=downscale,
                             type='solo',
                             spix=1024 * 16,
                             augmentation=True)

print('Number of samples: {}'.format(dataset.N))

# =============================================================================
# # The dataset can return an iterator.
# it = dataset.iter(10)
# print(next(it).shape)
# del it
#
# # Get all the data
# X = dataset.get_all_data().flatten()
#
# plt.hist(X, 100)
# print('min: {}'.format(np.min(X)))
Exemple #2
0
            uu = 0 + aa
            spix = 1024 * 52
            signal_length = 1024 * 52
            signal_split = [1024 * 18, 1024 * 6, 1024 * 4, 1024 * 6, 1024 * 18]
        elif model == 'basic':
            from audioinpainting.model_basic import InpaintingGAN
            uu = 50 + bb
            spix = 1024 * 52
            signal_length = 1024 * 52
            signal_split = [1024 * 24, 1024 * 4, 1024 * 24]
        else:
            raise ValueError(
                'Incorrect model; choose either "extend" or "basic"')

        dataset = load_audio_dataset(scaling=downscale,
                                     type=type,
                                     spix=spix,
                                     augmentation=True)

        # Check whether number of generated samples is consistent with total number of samples
        if N_f > dataset.N:
            N_f = dataset.N
        print('Number of samples: {}'.format(dataset.N))

        # ## Parameters
        bn = False
        md = 64

        params_discriminator = dict()
        params_discriminator['stride'] = [4, 4, 4, 4, 4]
        params_discriminator['nfilter'] = [md, 2 * md, 4 * md, 8 * md, 16 * md]
        params_discriminator['shape'] = [[25], [25], [25], [25], [25]]
Exemple #3
0
import matplotlib.pyplot as plt
from copy import deepcopy
from gantools import blocks
from audioinpainting.load import load_audio_dataset
from audioinpainting.model_extend import InpaintingGAN

# # Parameters

downscale = 2

# # Data handling
# Load the data 
start = time.time()
# dataset = data.load.load_audio_dataset(scaling=downscale)
dataset = load_audio_dataset(scaling=downscale, type='piano', spix=1024*52, augmentation=True)

print('Number of samples: {}'.format(dataset.N))


# =============================================================================
# # The dataset can return an iterator.
# it = dataset.iter(10)
# print(next(it).shape)
# del it
# 
# # Get all the data
# X = dataset.get_all_data().flatten()
# 
# plt.hist(X, 100)
# print('min: {}'.format(np.min(X)))