Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
9dc8d8f
1
Parent(s):
671aa36
Add custom loss to example.py
Browse files- example.py +1 -1
example.py
CHANGED
@@ -11,7 +11,7 @@ equations = pysr(X, y, niterations=5,
|
|
11 |
unary_operators=[
|
12 |
"cos", "exp", "sin", #Pre-defined library of operators (see https://pysr.readthedocs.io/en/latest/docs/operators/)
|
13 |
"inv(x) = 1/x"],
|
14 |
-
loss='
|
15 |
julia_project="../SymbolicRegression.jl") # Define your own operator! (Julia syntax)
|
16 |
|
17 |
...# (you can use ctl-c to exit early)
|
|
|
11 |
unary_operators=[
|
12 |
"cos", "exp", "sin", #Pre-defined library of operators (see https://pysr.readthedocs.io/en/latest/docs/operators/)
|
13 |
"inv(x) = 1/x"],
|
14 |
+
loss='loss(x, y) = abs(x - y)', # Custom loss function
|
15 |
julia_project="../SymbolicRegression.jl") # Define your own operator! (Julia syntax)
|
16 |
|
17 |
...# (you can use ctl-c to exit early)
|