Пример #1
0
def init (version = None, command = None, options = None):
    options = to_seq (options)

    condition = common.check_init_parameters ('darwin', None, ('version', version))

    command = common.get_invocation_command ('darwin', 'g++', command)

    common.handle_options ('darwin', condition, command, options)

    gcc.init_link_flags ('darwin', 'darwin', condition)
def init(version=None, command=None, options=None):
    options = to_seq(options)

    condition = common.check_init_parameters('darwin', None, ('version', version))

    command = common.get_invocation_command('darwin', 'g++', command)

    common.handle_options('darwin', condition, command, options)

    gcc.init_link_flags('darwin', 'darwin', condition)
Пример #3
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
Пример #4
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
Пример #5
0
def main(argv):
    global adt, pdt, sess, X_train, sfx
    options = handle_options('stack', argv)

    mnist_data = load_dataset()
    X_train = mnist_data[0].reshape(-1, 28, 28, 1)
    empty_stack_args = {'initializer': tf.random_uniform_initializer}
    adt, pdt = stack_adt(X_train,
                         options,
                         push_args=options,
                         nitems=options['nitems'],
                         pop_args=options,
                         empty_stack_args=empty_stack_args,
                         batch_size=options['batch_size'])

    options['dirname'] = gen_sfx_key(('adt', 'nitems'), options)
    sess = train(adt, pdt, options)
Пример #6
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)
Пример #7
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)
Пример #8
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)
Пример #9
0
def main(argv):
    global adt, 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)
    sfx = gen_sfx_key(('adt', 'nitems'), options)

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

    datadir = os.path.join(os.environ['DATADIR'], "pdt")
    savedir = mk_dir(sfx, datadir=datadir)
    options['sfx'] = sfx
    sess = train(adt, pdt, options, savedir, sfx)
Пример #10
0
def main(argv):
    print("ARGV", argv)
    options = handle_options('atari', argv)
    options['dirname'] = gen_sfx_key(('adt', ), options)
    adt, sess = run(options)
Пример #11
0
def main():
    options = handle_options('scalar_field', argv)
    run(options)