Add eval cap option
Browse files436 unmodified lines437438439440441442443166 unmodified lines610611612613614615436 unmodified linesindex = {n: i for i, n in enumerate(knots["name"])}gallery = model.embed(knots["pd"]).to(device)test = table(args.data, "diagrams", "test")longest = model.positions.num_embeddings // 2test = test.filter(lambda row: len(row["pd"]) <= longest)if args.limit:test = test.select(random.Random(0).sample(range(len(test)), min(args.limit, len(test))))166 unmodified lineseval_parser.add_argument("--repo", default=REPO, help="where --push stores the result")eval_parser.add_argument("--revision", default=None, help="model branch")eval_parser.add_argument("--result", default="eval", help="results/<result>.json for --push")eval_parser.add_argument("--output", default="out/eval", help="where the knot map goes")eval_parser.add_argument("--push", action="store_true")eval_parser.set_defaults(run=evaluate)436 unmodified lines437438439440441442443166 unmodified lines610611612613614615616436 unmodified linesindex = {n: i for i, n in enumerate(knots["name"])}gallery = model.embed(knots["pd"]).to(device)test = table(args.data, "diagrams", "test")longest = args.eval_max_crossings or model.positions.num_embeddings // 2test = test.filter(lambda row: len(row["pd"]) <= longest)if args.limit:test = test.select(random.Random(0).sample(range(len(test)), min(args.limit, len(test))))166 unmodified lineseval_parser.add_argument("--repo", default=REPO, help="where --push stores the result")eval_parser.add_argument("--revision", default=None, help="model branch")eval_parser.add_argument("--result", default="eval", help="results/<result>.json for --push")eval_parser.add_argument("--eval-max-crossings", type=int, default=None)eval_parser.add_argument("--output", default="out/eval", help="where the knot map goes")eval_parser.add_argument("--push", action="store_true")eval_parser.set_defaults(run=evaluate)
knot2vec.py+2-1