Example #1
0
import re

if __name__ == '__main__':

    device = get_device()

    system_train = 'two_spins'
    system_test = 'two_spins'
    if system_test in ['ospm', 'two_spins']:
        size = 16
    elif system_test in ['os']:
        size = 4
    else:
        raise ValueError('unsupported test system')

    path_train = get_path(
    ) + f'/dl/datasets/floquet_lindbladian/{system_train}'
    path_test = get_path() + f'/dl/datasets/floquet_lindbladian/{system_test}'

    suffix_train = 'ampl(0.5000_0.5000_200)_freq(0.0500_0.0500_200)_phase(0.0000_0.0000_0)'
    suffix_test = 'ampl(0.5000_0.5000_200)_freq(0.0500_0.0500_200)_phase(1.5708_0.0000_0)'

    # Models to choose from [resnet, resnet50_2D, alexnet, vgg, squeezenet, densenet, inception]
    model_name = "resnet"

    feature_type = 'eval'
    transforms_type = 'regular'
    label_type = 'log'

    model_dir = f'{path_train}/{model_name}_{feature_type}_{transforms_type}_{label_type}_{suffix_train}'

    num_classes = 1
Example #2
0
import os

if __name__ == '__main__':

    device = get_device()

    system = 'two_spins'
    if system in ['ospm', 'two_spins']:
        size = 16
    elif system in ['os']:
        size = 4
    else:
        raise ValueError('unsupported test system')
    input_size = 224

    path = get_path() + f'/dl/datasets/floquet_lindbladian/{system}'

    num_points = 200
    suffix = f'ampl(0.5000_0.5000_{num_points})_freq(0.0500_0.0500_{num_points})_phase(0.0000_0.0000_0)'

    feature_type = 'eval'
    transforms_type = 'noNorm'
    label_type = 'log'

    if transforms_type == 'regular':
        transforms_regular = transforms.Compose([
            transforms.ToPILImage(),
            transforms.Resize((input_size, input_size)),
            transforms.ToTensor(),
            transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
        ])