Esempio n. 1
0
    create_range_compress_transforms, chain_transformations, \
    atleast_3d, squeeze

from src.features.transforms import create_fcs

folder = os.path.basename(os.path.dirname(__file__))
subfolder = os.path.splitext(os.path.basename(__file__))[0]
name = '/' + folder + '/' + subfolder + '/'

from src.configs.schedules.round_16.stock import Schedule
from src.configs.resnet.dim256x1 import g_structure
from src.configs.patchgan.dim256x2_70_nobn_nosig import d_structure

fc_transform, fc_transform_inv = create_fcs(k_values={
    'dm': 2,
    'pressure': 4
},
                                            scale=1.75,
                                            shift=-1)

transform = chain_transformations([fc_transform, atleast_3d])

inv_transform = chain_transformations([squeeze, fc_transform_inv])

schedule = Schedule(name)
schedule['sample_interval'] = 100
schedule['batch_size'] = 4
schedule['decay_iter'] = 10
schedule['g_optim_opts']['lr'] = 0.0002
schedule['d_optim_opts']['lr'] = 0.0002
schedule['save_summary']['iters'] = [1] + np.arange(0, 10000, 50).tolist()
Esempio n. 2
0
adam_opts = {
    'lr': 0.001,
    'betas': (0.9, 0.999),
    'eps': 1e-08,
    'weight_decay': 0,
    'amsgrad': False
}

loss_params = {'n_critic': 5, 'grad_lambda': 10, 'l1_lambda': (1e4) / 0.05}

paper_opts = adam_opts
paper_opts['betas'] = (0.5, 0.999)
paper_opts['lr'] = 0.0002

fc_transform, fc_transform_inv = create_fcs(k=4, scale=1.75, shift=-1)

transform = chain_transformations([fc_transform, atleast_3d])

inv_transform = chain_transformations([squeeze, fc_transform_inv])


def Schedule(name,
             transform=transform,
             inv_transform=inv_transform,
             loss_params=loss_params,
             paper_opts=paper_opts,
             epoch_end=100,
             n_test=64):
    schedule = {
        'type': 'translator',