copyproblem.py
def main():
  """ Generate and save Copy Problem train, val, and test sets. """

  description = main.__doc__
  formatter_class = argparse.ArgumentDefaultsHelpFormatter
  parser = argparse.ArgumentParser(description=description, formatter_class=formatter_class)
  parser.add_argument('--data_dir', type=str, default=DEFAULT_DATA_DIR,
                      help='''The directory to save data in.''')
  parser.add_argument('--delay', type=int, default=100,
                      help='''The delay between presentation time and copy time. Must be divisible by 10.''')
  parser.add_argument('--num_possible_symbols', type=int, default=10,
                      help='''The number of possible symbols.''')
  parser.add_argument('--num_train_examples', type=int, default=100000,
                      help='''The number of train examples to generate.''')
  parser.add_argument('--num_val_examples', type=int, default=1000,
                      help='''The number of validation examples to generate.''')
  parser.add_argument('--num_test_examples', type=int, default=10000,
                      help='''The number of test examples to generate.''')
  args = parser.parse_args()

  num_examples = {
    'train': args.num_train_examples,
    'val': args.num_val_examples,
    'test': args.num_test_examples
  }

  if not os.path.exists(args.data_dir):
    os.makedirs(args.data_dir)

  for name in ['train', 'val', 'test']:
    print('Generating %s data ..' % name)
    inputs, targets = generate_inputs_and_targets(args.delay, num_examples[name], args.num_possible_symbols)
    inputs_path = os.path.join(args.data_dir, INPUT_FILENAME_PATTERN % (args.delay, args.num_possible_symbols, name))
    np.save(inputs_path, inputs)
    targets_path = os.path.join(args.data_dir, TARGET_FILENAME_PATTERN % (args.delay, args.num_possible_symbols, name))
    np.save(targets_path, targets)
 Generate and save Copy Problem train, val, and test sets. 
Generate and save Copy Problem train, val, and test sets.
Generate and save Copy Problem train val and test sets .
def main():
  description = main.__doc__
  formatter_class = argparse.ArgumentDefaultsHelpFormatter
  parser = argparse.ArgumentParser(description=description, formatter_class=formatter_class)
  parser.add_argument('--data_dir', type=str, default=DEFAULT_DATA_DIR,
                      help='''The directory to save data in.''')
  parser.add_argument('--delay', type=int, default=100,
                      help='''The delay between presentation time and copy time. Must be divisible by 10.''')
  parser.add_argument('--num_possible_symbols', type=int, default=10,
                      help='''The number of possible symbols.''')
  parser.add_argument('--num_train_examples', type=int, default=100000,
                      help='''The number of train examples to generate.''')
  parser.add_argument('--num_val_examples', type=int, default=1000,
                      help='''The number of validation examples to generate.''')
  parser.add_argument('--num_test_examples', type=int, default=10000,
                      help='''The number of test examples to generate.''')
  args = parser.parse_args()
  num_examples = {
    'train': args.num_train_examples,
    'val': args.num_val_examples,
    'test': args.num_test_examples
  }
  if not os.path.exists(args.data_dir):
    os.makedirs(args.data_dir)
  for name in ['train', 'val', 'test']:
    print('Generating %s data ..' % name)
    inputs, targets = generate_inputs_and_targets(args.delay, num_examples[name], args.num_possible_symbols)
    inputs_path = os.path.join(args.data_dir, INPUT_FILENAME_PATTERN % (args.delay, args.num_possible_symbols, name))
    np.save(inputs_path, inputs)
    targets_path = os.path.join(args.data_dir, TARGET_FILENAME_PATTERN % (args.delay, args.num_possible_symbols, name))
    np.save(targets_path, targets)
def main ( ) : description = main . __doc__ formatter_class = argparse . ArgumentDefaultsHelpFormatter parser = argparse . ArgumentParser ( description = description , formatter_class = formatter_class ) parser . add_argument ( '--data_dir' , type = str , default = DEFAULT_DATA_DIR , help = '''The directory to save data in.''' ) parser . add_argument ( '--delay' , type = int , default = 100 , help = '''The delay between presentation time and copy time. Must be divisible by 10.''' ) parser . add_argument ( '--num_possible_symbols' , type = int , default = 10 , help = '''The number of possible symbols.''' ) parser . add_argument ( '--num_train_examples' , type = int , default = 100000 , help = '''The number of train examples to generate.''' ) parser . add_argument ( '--num_val_examples' , type = int , default = 1000 , help = '''The number of validation examples to generate.''' ) parser . add_argument ( '--num_test_examples' , type = int , default = 10000 , help = '''The number of test examples to generate.''' ) args = parser . parse_args ( ) num_examples = { 'train' : args . num_train_examples , 'val' : args . num_val_examples , 'test' : args . num_test_examples } if not os . path . exists ( args . data_dir ) : os . makedirs ( args . data_dir ) for name in [ 'train' , 'val' , 'test' ] : print ( 'Generating %s data ..' % name ) inputs , targets = generate_inputs_and_targets ( args . delay , num_examples [ name ] , args . num_possible_symbols ) inputs_path = os . path . join ( args . data_dir , INPUT_FILENAME_PATTERN % ( args . delay , args . num_possible_symbols , name ) ) np . save ( inputs_path , inputs ) targets_path = os . path . join ( args . data_dir , TARGET_FILENAME_PATTERN % ( args . delay , args . num_possible_symbols , name ) ) np . save ( targets_path , targets )
Generate and save Copy Problem train, val, and test sets.
Generate and save Copy Problem train val and test sets .
""" Generate and save Copy Problem train, val, and test sets. """