row += [([fill] * maxlen0)] * (maxlen1 - len(row)) return values def align(values, fill=0): dim = 0 inp = values while isinstance(inp, list): dim += 1 inp = inp[0] if dim == 1: return values elif dim == 2: return align2d(values, fill) elif dim == 3: return align3d(values, fill) else: raise NotImplementedError() if __name__ == '__main__': import argparse import options parser = argparse.ArgumentParser() options.data_opts(parser) options.train_opts(parser) opt = parser.parse_args() dataset = Dataset(opt) feeder = TrainFeeder(dataset) feeder.prepare('train') feeder.next(4)
def make_options(): parser = argparse.ArgumentParser(description='train.py') options.model_opts(parser) options.evaluate_opts(parser) options.data_opts(parser) return parser.parse_args()
def make_options(): parser = argparse.ArgumentParser() options.preprocess_opts(parser) options.data_opts(parser) return parser.parse_args()