Beispiel #1
0
                      background_color="white",
                      colormap="tab20").generate_from_frequencies(frequencies)
    plt.clf()
    plt.figure(figsize=(hsize, vsize))
    plt.imshow(cloud, interpolation='bilinear', aspect="equal")
    plt.axis("off")
    plt.tight_layout()
    plt.savefig(name + ".pdf", figsize=(5, vsize), dpi=400)

    from scipy.misc import imsave
    imsave(name + '.png', cloud)


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    arg(parser, 'name', type=str, default="", help='name for plots')
    arg(parser,
        'raw',
        type=bool,
        default=True,
        help='Use raw vectors rather than UMAP ones.')
    arg(parser,
        'alpha',
        type=float,
        default=1.,
        help='Float for alpha in divergence.')
    arg(parser,
        'rbf',
        type=bool,
        default=False,
        help='Use RBF rather than cosine similarity.')
Beispiel #2
0
import argparse
import glob
import os

import torch

from pylego.misc import add_argument as arg

from runners.fixedrunner import FixedRunner
from runners.advrunner import AdversarialRunner

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    arg(parser, 'name', type=str, required=True, help='name of the experiment')
    arg(parser, 'model', type=str, default='fixed.fixed', help='model to use')
    arg(parser, 'cuda', type=bool, default=True, help='enable CUDA')
    arg(parser,
        'double_precision',
        type=bool,
        default=False,
        help='use double precision')
    arg(parser,
        'load_file',
        type=str,
        default='',
        help='file to load model from')
    arg(parser,
        'save_file',
        type=str,
        default='model.dat',
        help='model save file')
Beispiel #3
0
import argparse
import os

from pylego.misc import add_argument as arg

from runners.tdvaerunner import TDVAERunner

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    arg(parser, 'name', type=str, required=True, help='name of the experiment')
    arg(parser, 'model', type=str, default='tdvae.tdvae', help='model to use')
    arg(parser, 'cuda', type=bool, default=True, help='enable CUDA')
    arg(parser,
        'load_file',
        type=str,
        default='',
        help='file to load model from')
    arg(parser,
        'save_file',
        type=str,
        default='model.dat',
        help='model save file')
    arg(parser,
        'save_every',
        type=int,
        default=500,
        help='save every these many global steps (-1 to disable saving)')
    arg(parser, 'data_path', type=str, default='data/MNIST')
    arg(parser, 'logs_path', type=str, default='logs')
    arg(parser, 'force_logs', type=bool, default=False)
    arg(parser, 'optimizer', type=str, default='adam', help='one of: adam')
Beispiel #4
0
import argparse
import glob
import os
from shutil import copyfile
import sys

from pylego.misc import add_argument as arg

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    arg(parser,
        'logs_path',
        type=str,
        default='../logs',
        help='input logs directory')
    arg(parser, 'out_path', type=str, default='out', help='output directory')
    arg(parser,
        'name_pattern',
        type=str,
        default='*',
        help='names to match in logs directory')
    arg(parser,
        'step',
        type=int,
        default=-1,
        help='override comparison step if greater than 0')
    arg(parser,
        'min_step',
        type=int,
        default=-1,
        help='minimum step to dump if greater than 0')
Beispiel #5
0
import argparse
import os

from pylego.misc import add_argument as arg

from runners.imgtdvae.tdvaerunner import TDVAERunner
from runners.conditional.gym_runner import GymRunner
from runners.rl.rl_runner import GymRLRunner

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    arg(parser, 'name', type=str, required=True, help='name of the experiment')
    arg(parser,
        'model',
        type=str,
        default='conditional.gymtdvae',
        help='model to use')
    arg(parser, 'cuda', type=bool, default=True, help='enable CUDA')
    arg(parser,
        'load_file',
        type=str,
        default='',
        help='file to load model from')
    arg(parser,
        'save_file',
        type=str,
        default='model.dat',
        help='model save file')
    arg(parser,
        'save_every',
        type=int,