Spaces:
Running
Running
Commit
·
ea4213e
1
Parent(s):
cfca8a4
Explain all args in python file
Browse files
eureqa.py
CHANGED
|
@@ -56,6 +56,7 @@ def eureqa(threads=4, parsimony=1e-3, alpha=10,
|
|
| 56 |
|
| 57 |
with open('.hyperparams.jl', 'w') as f:
|
| 58 |
print(def_hyperparams, file=f)
|
|
|
|
| 59 |
with open('.dataset.jl', 'w') as f:
|
| 60 |
print(def_datasets, file=f)
|
| 61 |
|
|
@@ -71,8 +72,21 @@ def eureqa(threads=4, parsimony=1e-3, alpha=10,
|
|
| 71 |
|
| 72 |
if __name__ == "__main__":
|
| 73 |
parser = ArgumentParser()
|
| 74 |
-
parser.add_argument("--threads", type=int, default=4, help="
|
| 75 |
-
parser.add_argument("--parsimony", type=float, default=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
parser.add_argument(
|
| 77 |
"--binary-operators", type=str, nargs="+", default=["plus", "mul"],
|
| 78 |
help="Binary operators. Make sure they are defined in operators.jl")
|
|
|
|
| 56 |
|
| 57 |
with open('.hyperparams.jl', 'w') as f:
|
| 58 |
print(def_hyperparams, file=f)
|
| 59 |
+
|
| 60 |
with open('.dataset.jl', 'w') as f:
|
| 61 |
print(def_datasets, file=f)
|
| 62 |
|
|
|
|
| 72 |
|
| 73 |
if __name__ == "__main__":
|
| 74 |
parser = ArgumentParser()
|
| 75 |
+
parser.add_argument("--threads", type=int, default=4, help="Number of threads")
|
| 76 |
+
parser.add_argument("--parsimony", type=float, default=0.001, help="How much to punish complexity")
|
| 77 |
+
parser.add_argument("--alpha", type=int, default=10, help="Scaling of temperature")
|
| 78 |
+
parser.add_argument("--maxsize", type=int, default=20, help="Max size of equation")
|
| 79 |
+
parser.add_argument("--niterations", type=int, default=20, help="Number of total migration periods")
|
| 80 |
+
parser.add_argument("--npop", type=int, default=100, help="Number of members per population")
|
| 81 |
+
parser.add_argument("--ncyclesperiteration", type=int, default=5000, help="Number of evolutionary cycles per migration")
|
| 82 |
+
parser.add_argument("--topn", type=int, default=10, help="How many best species to distribute from each population")
|
| 83 |
+
parser.add_argument("--fractionReplacedHof", type=float, default=0.1, help="Fraction of population to replace with hall of fame")
|
| 84 |
+
parser.add_argument("--fractionReplaced", type=float, default=0.1, help="Fraction of population to replace with best from other populations")
|
| 85 |
+
parser.add_argument("--migration", type=bool, default=True, help="Whether to migrate")
|
| 86 |
+
parser.add_argument("--hofMigration", type=bool, default=True, help="Whether to have hall of fame migration")
|
| 87 |
+
parser.add_argument("--shouldOptimizeConstants", type=bool, default=True, help="Whether to use classical optimization on constants before every migration (doesn't impact performance that much)")
|
| 88 |
+
parser.add_argument("--annealing", type=bool, default=True, help="Whether to use simulated annealing")
|
| 89 |
+
|
| 90 |
parser.add_argument(
|
| 91 |
"--binary-operators", type=str, nargs="+", default=["plus", "mul"],
|
| 92 |
help="Binary operators. Make sure they are defined in operators.jl")
|