Example #1
0
def init(task, args_ranges):
    """Sets up the task and argument ranges"""
    global _task_fun
    global _task_args_ranges
    global _num_tasks
    _task_fun = task
    _task_args_ranges = args_ranges
    _num_tasks = num_ids_from_args(_task_args_ranges)
Example #2
0
#n_hidden_layers = 1
#hidden_dim_mults = [16, 32, 64]
#for optimizer in ['Adam']:
##for optimizer in ['Adam', 'Adamax']:
##for optimizer in ['Adam', Adagrad']:
#  algorithms.append('ae%d_%%sxR_%s' % (hidden_dim_mult, optimizer))
#  algorithms.append('ae%d_%%sxR_dropout12_%s' % (hidden_dim_mult, optimizer))
#  algorithms.append('ae%d_%%sxR_dropout25_%s' % (hidden_dim_mult, optimizer))
#  algorithms.append('ae%d_%%sxR_batchnorm_%s' % (hidden_dim_mult, optimizer))
#fig_name_suffix = "_ae%d" % (n_hidden_layers)

args = (data_sets, input_dims, repr_dims)

#tiled = False
#tiled = (3, 2) 
tiled = (num_ids_from_args((input_dims,)), num_ids_from_args((repr_dims,)))

figsize = (12.0, 9.0) 

relative_to = None
#relative_to = 'pca'

if tiled:
  plt.figure(figsize=(tiled[0]*figsize[0], tiled[1]*figsize[1]))

#for d, data_set in enumerate(data_sets):
#  print("data = %s" % data_set)
#  for i, input_dim in enumerate(input_dims):
#    print(" input_dim = %s" % input_dim)
#    for r, repr_dim in enumerate(repr_dims):
#      print(" repr_dim = %d" % repr_dim)
# algorithms
algorithms = [
    #'pca',
    'ae1_64xR_dropout12_Adam',
    'ae2_32xR_dropout12_Adam',
    'ae3_32xR_dropout12_Adam',
]

fig_name_suffix = ""

args = (data_sets, repr_dims)

#tiled = False
#tiled = (3, 2)
tiled = (1, num_ids_from_args((repr_dims, )))

figsize = (12.0, 9.0)

relative_to = None
#relative_to = 'pca'

if tiled:
    plt.figure(figsize=(tiled[0] * figsize[0], tiled[1] * figsize[1]))

for i in range(num_ids_from_args(args)):
    (data_set, repr_dim) = args_from_id(i, args)
    print("data = %s, repr_dim = %3d" % (data_set, repr_dim))
    if tiled:
        plt.subplot(tiled[1], tiled[0], i + 1)
    else: