Spaces:
Running
Running
Commit
·
671aa36
1
Parent(s):
6143e3c
Add additional examples of losses
Browse files- docs/options.md +28 -0
docs/options.md
CHANGED
|
@@ -167,3 +167,31 @@ e.g., `loss="myloss(x, y) = abs(x - y)^1.5"`. For more details,
|
|
| 167 |
see the
|
| 168 |
[Losses](https://milescranmer.github.io/SymbolicRegression.jl/dev/losses/)
|
| 169 |
page for SymbolicRegression.jl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
see the
|
| 168 |
[Losses](https://milescranmer.github.io/SymbolicRegression.jl/dev/losses/)
|
| 169 |
page for SymbolicRegression.jl.
|
| 170 |
+
|
| 171 |
+
Here are some additional examples:
|
| 172 |
+
|
| 173 |
+
abs(x-y) loss
|
| 174 |
+
```python
|
| 175 |
+
pysr(..., loss="f(x, y) = abs(x - y)^1.5")
|
| 176 |
+
```
|
| 177 |
+
Note that the function name doesn't matter:
|
| 178 |
+
```python
|
| 179 |
+
pysr(..., loss="loss(x, y) = abs(x * y)")
|
| 180 |
+
```
|
| 181 |
+
With weights:
|
| 182 |
+
```python
|
| 183 |
+
pysr(..., weights=weights, loss="myloss(x, y, w) = w * abs(x - y)")
|
| 184 |
+
```
|
| 185 |
+
Weights can be used in arbitrary ways:
|
| 186 |
+
```python
|
| 187 |
+
pysr(..., weights=weights, loss="myloss(x, y, w) = abs(x - y)^2/w^2")
|
| 188 |
+
```
|
| 189 |
+
Built-in loss (faster) (see [losses](https://astroautomata.com/SymbolicRegression.jl/dev/losses/)).
|
| 190 |
+
This one computes the L3 norm:
|
| 191 |
+
```python
|
| 192 |
+
pysr(..., loss="LPDistLoss{3}()")
|
| 193 |
+
```
|
| 194 |
+
Can also uses these losses for weighted (weighted-average):
|
| 195 |
+
```python
|
| 196 |
+
pysr(..., weights=weights, loss="LPDistLoss{3}()")
|
| 197 |
+
```
|