MilesCranmer commited on
Commit
9dc8d8f
1 Parent(s): 671aa36

Add custom loss to example.py

Browse files
Files changed (1) hide show
  1. 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='L1DistLoss()',
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)