Exemple #1
0
def main(argv):

    options = handle_options('set', argv)

    mnist_data = load_dataset()
    X_train = mnist_data[0].reshape(-1, 28, 28, 1)
    sfx = gen_sfx_key(('adt', 'nblocks', 'block_size'), options)

    empty_set_args = {'initializer': tf.random_uniform_initializer}
    set_adt, set_pdt = gen_set_adt(X_train,
                                   options,
                                   store_args=options,
                                   is_in_args=options,
                                   size_args=options,
                                   is_empty_args=options,
                                   empty_set_args=empty_set_args,
                                   nitems=options['nitems'],
                                   batch_size=options['batch_size'])

    graph = tf.get_default_graph()
    savedir = mk_dir(sfx)

    path_name = os.path.join(
        os.environ['DATADIR'],
        'graphs',
        sfx,
    )
    tf.train.SummaryWriter(path_name, graph)

    load_train_save(options, set_adt, set_pdt, sfx, savedir)
    push, pop = pdt.call_fns
Exemple #2
0
def main(argv):
    options = handle_options('map', argv)
    sfx = gen_sfx_key(('adt', 'nblocks', 'block_size'), options)
    empty_map_args = {'initializer': tf.random_uniform_initializer}
    map_adt, map_pdt = gen_map_adt(1,
                                   10,
                                   options,
                                   dist_args=options,
                                   add_dist_args=options,
                                   empty_map_args=empty_map_args,
                                   batch_size=options['batch_size'])

    graph = tf.get_default_graph()
    savedir = mk_dir(sfx)
    load_train_save(options, map_adt, map_pdt, sfx, savedir)
    push, pop = map_pdt.call_fns
Exemple #3
0
def run(options):
    # voxel_grids = np.load("/DATADIR/data/ModelNet40/alltrain32.npy")
    field_args = {'initializer': tf.random_uniform_initializer}
    adt, pdt = scalar_field_adt(options,
                                s_args=options,
                                translate_args=options,
                                npoints=500,
                                field_shape=(102, ),
                                add_args=options,
                                field_args=field_args,
                                batch_size=options['batch_size'])

    sfx = gen_sfx_key(('adt', 'nblocks', 'block_size'), options)
    graph = tf.get_default_graph()

    savedir = mk_dir(sfx)
    load_train_save(options, adt, pdt, sfx, savedir)
Exemple #4
0
def main(argv):
    global adt, pdt, sess
    options = handle_options('number', argv)
    sfx = gen_sfx_key(('adt', 'template', 'nblocks', 'block_size'), options)
    zero_args = {'initializer': tf.random_uniform_initializer}

    adt, pdt = gen_number_adt(options,
                              number_shape=(10, ),
                              succ_args=options,
                              add_args=options,
                              mul_args=options,
                              encode_args=options,
                              decode_args=options,
                              zero_args=zero_args,
                              batch_size=options['batch_size'])

    savedir = mk_dir(sfx)
    sess = load_train_save(options, adt, pdt, sfx, savedir)
Exemple #5
0
def main(argv):
    global queue_adt, queue_pdt, sess, X_train, sfx
    options = handle_options('queue', argv)

    mnist_data = load_dataset()
    X_train = mnist_data[0].reshape(-1, 28, 28, 1)
    sfx = gen_sfx_key(('adt', 'nblocks', 'block_size'), options)

    empty_queue_args = {'initializer': tf.random_uniform_initializer}
    queue_adt, queue_pdt = gen_queue_adt(X_train,
                                         options,
                                         enqueue_args=options,
                                         nitems=options['nitems'],
                                         dequeue_args=options,
                                         empty_queue_args=empty_queue_args,
                                         batch_size=options['batch_size'])

    savedir = mk_dir(sfx)
    sess = load_train_save(options, queue_adt, queue_pdt, sfx, savedir)
Exemple #6
0
def main(argv):
    global adt, pdt, sess, X_train, sfx
    options = handle_options('eqstack', argv)

    mnist_data = load_dataset()
    X_train = mnist_data[0].reshape(-1, 28, 28, 1)
    #sfx = gen_sfx_key(('adt', 'nblocks', 'block_size'), options)
    sfx = gen_sfx_key(('adt', 'nitems'), options)

    empty_eqstack_args = {'initializer': tf.random_uniform_initializer}
    adt, pdt = eqstack_adt(X_train,
                           options,
                           push_args=options,
                           nitems=options['nitems'],
                           pop_args=options,
                           empty_eqstack_args=empty_eqstack_args,
                           batch_size=options['batch_size'])

    savedir = mk_dir(sfx)
    sess = load_train_save(options, adt, pdt, sfx, savedir)