Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
dcb0894
1
Parent(s):
c4bc4e3
Update hyperparams and docs to insertionOp
Browse files
README.md
CHANGED
@@ -59,11 +59,11 @@ which gives:
|
|
59 |
### API
|
60 |
|
61 |
What follows is the API reference for running the numpy interface.
|
62 |
-
|
63 |
-
|
64 |
-
equations, so you likely don't need to tune them yourself.
|
65 |
However, you should adjust `threads`, `niterations`,
|
66 |
-
`binary_operators`, `unary_operators`, and `maxsize`
|
|
|
67 |
|
68 |
The program will output a pandas DataFrame containing the equations,
|
69 |
mean square error, and complexity. It will also dump to a csv
|
|
|
59 |
### API
|
60 |
|
61 |
What follows is the API reference for running the numpy interface.
|
62 |
+
You likely don't need to tune the hyperparameters yourself,
|
63 |
+
but if you would like, you can use `hyperopt.py` as an example.
|
|
|
64 |
However, you should adjust `threads`, `niterations`,
|
65 |
+
`binary_operators`, `unary_operators`, and `maxsize`
|
66 |
+
to your requirements.
|
67 |
|
68 |
The program will output a pandas DataFrame containing the equations,
|
69 |
mean square error, and complexity. It will also dump to a csv
|
eureqa.jl
CHANGED
@@ -739,7 +739,6 @@ function fullRun(niterations::Integer;
|
|
739 |
# Spawn threads to run indepdent evolutions, then gather them
|
740 |
@inbounds Threads.@threads for i=1:nthreads
|
741 |
allPops[i] = run(allPops[i], ncyclesperiteration, annealing, verbosity=verbosity)
|
742 |
-
topn = npop
|
743 |
bestSubPops[i] = bestSubPop(allPops[i], topn=topn)
|
744 |
for j=1:bestSubPops[i].n
|
745 |
bestSubPops[i].members[j].tree = simplifyTree(bestSubPops[i].members[j].tree)
|
|
|
739 |
# Spawn threads to run indepdent evolutions, then gather them
|
740 |
@inbounds Threads.@threads for i=1:nthreads
|
741 |
allPops[i] = run(allPops[i], ncyclesperiteration, annealing, verbosity=verbosity)
|
|
|
742 |
bestSubPops[i] = bestSubPop(allPops[i], topn=topn)
|
743 |
for j=1:bestSubPops[i].n
|
744 |
bestSubPops[i].members[j].tree = simplifyTree(bestSubPops[i].members[j].tree)
|
eureqa.py
CHANGED
@@ -6,21 +6,21 @@ import numpy as np
|
|
6 |
import pandas as pd
|
7 |
|
8 |
# Dumped from hyperparam optimization
|
9 |
-
default_alpha =
|
10 |
-
default_fractionReplaced =
|
11 |
-
default_fractionReplacedHof =
|
12 |
-
default_npop =
|
13 |
-
default_weightAddNode = 1
|
14 |
-
default_weightInsertNode = 1
|
15 |
-
default_weightDeleteNode =
|
16 |
-
default_weightMutateConstant =
|
17 |
-
default_weightMutateOperator =
|
18 |
-
default_weightRandomize =
|
19 |
-
default_weightSimplify =
|
20 |
-
default_weightDoNothing = 1
|
21 |
-
default_result =
|
22 |
-
default_topn =
|
23 |
-
default_parsimony =
|
24 |
|
25 |
|
26 |
def eureqa(X=None, y=None, threads=4,
|
@@ -33,7 +33,7 @@ def eureqa(X=None, y=None, threads=4,
|
|
33 |
fractionReplaced=default_fractionReplaced,
|
34 |
fractionReplacedHof=default_fractionReplacedHof,
|
35 |
npop=int(default_npop),
|
36 |
-
parsimony=
|
37 |
migration=True,
|
38 |
hofMigration=True,
|
39 |
shouldOptimizeConstants=True,
|
|
|
6 |
import pandas as pd
|
7 |
|
8 |
# Dumped from hyperparam optimization
|
9 |
+
default_alpha = 5
|
10 |
+
default_fractionReplaced = 0.1
|
11 |
+
default_fractionReplacedHof = 0.1
|
12 |
+
default_npop = 200
|
13 |
+
default_weightAddNode = 1
|
14 |
+
default_weightInsertNode = 1
|
15 |
+
default_weightDeleteNode = 1
|
16 |
+
default_weightMutateConstant = 10
|
17 |
+
default_weightMutateOperator = 1
|
18 |
+
default_weightRandomize = 1
|
19 |
+
default_weightSimplify = 1
|
20 |
+
default_weightDoNothing = 1
|
21 |
+
default_result = 1
|
22 |
+
default_topn = 10
|
23 |
+
default_parsimony = 0.0
|
24 |
|
25 |
|
26 |
def eureqa(X=None, y=None, threads=4,
|
|
|
33 |
fractionReplaced=default_fractionReplaced,
|
34 |
fractionReplacedHof=default_fractionReplacedHof,
|
35 |
npop=int(default_npop),
|
36 |
+
parsimony=default_parsimony,
|
37 |
migration=True,
|
38 |
hofMigration=True,
|
39 |
shouldOptimizeConstants=True,
|
operators.jl
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
# Define allowed operators. Any julia operator can also be used.
|
2 |
-
plus(x::Float32, y::Float32)::Float32 = x+y
|
3 |
-
mult(x::Float32, y::Float32)::Float32 = x*y
|
4 |
pow(x::Float32, y::Float32)::Float32 = sign(x)*abs(x)^y
|
5 |
div(x::Float32, y::Float32)::Float32 = x/y
|
6 |
loga(x::Float32)::Float32 = log(abs(x) + 1)
|
|
|
1 |
# Define allowed operators. Any julia operator can also be used.
|
2 |
+
plus(x::Float32, y::Float32)::Float32 = x+y #Do not change the name of this operator.
|
3 |
+
mult(x::Float32, y::Float32)::Float32 = x*y #Do not change the name of this operator.
|
4 |
pow(x::Float32, y::Float32)::Float32 = sign(x)*abs(x)^y
|
5 |
div(x::Float32, y::Float32)::Float32 = x/y
|
6 |
loga(x::Float32)::Float32 = log(abs(x) + 1)
|