コード例 #1
0
def print_net(name, net, init_name, init_gain):
    name = '{:^80s}'.format(name)

    s = 'Class: {}\n'.format(net.__class__.__name__)
    s += 'Init: {}, Gain={}\n'.format(init_name, init_gain)
    s += 'Number of parameters : {:.3f}\n'.format(num_params(net) / 1e6)
    print(pretty_wrap(title=name, text=s))
コード例 #2
0
def print_dataset(name, dl, config):
    """
    Arguments:
        dl (torch.utils.data.DataLoader): dataset to print
    """
    name = '{:^80s}'.format(name)
    s = 'Class: {}\n'.format(dl.dataset.__class__.__name__)
    s += 'Length: Effective {}, Dataset: {}\n' \
        .format(dataset_length(dl), len(dl.dataset))
    s += 'Batch size: {}\n'.format(dl.batch_size)
    s += 'Config: \n'
    s += pprint.pformat(config)
    print(pretty_wrap(title=name, text=s, width=180))
コード例 #3
0
def print_net(name, net, init_name, init_gain):
    s = f'Class: {net.__class__.__name__:}\n' \
        f'Init: {init_name}, Gain={init_gain}\n' \
        f'Number of parameters : {num_params(net) / 1e6:.3f}\n'
    print(pretty_wrap(title=name, text=s))