Skip to content

Commit 963b44a

Browse files
Update API.md
1 parent 151f584 commit 963b44a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docs/API.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,28 +384,31 @@ auto new_loss = CreateNumDiffFunc1(x, original_loss);
384384
second or pseudo-second order methods, which use both gradient and Hessian.
385385
386386
### Losses, Norms and Robust Norms
387-
You can play with different losses, robust norms and M-estimators, have a look at the `loss` fold er.
387+
You can play with different losses, activation functions, robust norms and M-estimators, have a look at the `losses` folder.
388388
389389
All losses and other norms follow the signature: `Name(x, export_or_jacobian)` or `Name(x, threshold, export_or_jacobian)` for robust norms.
390390
391-
* `export_or_jacobian` is either skipped and the loss/norm will be the only output of the function.
392-
* If it is `true`, the Jacobian of the loss will be returned as well as the loss.
393-
* Finally, if it is a matrix/vector representing a forward Jacobian, then the second returned value will be the transformed Jacobian using the chain rule.
391+
`export_or_jacobian` is either
392+
* `nullptr` or skipped and the loss/norm will be the only output of the function.
393+
* `true`, the Jacobian of the loss will be returned as well as the loss.
394+
* a matrix/vector representing a forward Jacobian, then the second returned value will be the transformed Jacobian using the chain rule.
394395
395396
Here is an example of how to get a Huber norm.
396397
397398
```cpp
398-
double robust_norm = Huber(y.squaredNorm(), 0.8);
399+
double robust_norm2 = Huber(y.squaredNorm(), 0.8);
399400
```
400401

401402
Here is another example of how to call a Huber norm and recover the scale/Jacobian of it or the transformed jacobian.
402403

403404
```cpp
404-
const auto &[robust_norm, J] = Huber(y.squaredNorm(), 0.8, true);
405+
const auto &[robust_norm2, J] = Huber(y.squaredNorm(), 0.8, true);
406+
```
405407

406408
or
407409

408-
const auto &[robust_norm, J] = Huber(y.squaredNorm(), 0.8, Jy);
410+
```cpp
411+
const auto &[robust_norm2, J] = Huber(y.squaredNorm(), 0.8, Jy);
409412

410413
```
411414

0 commit comments

Comments
 (0)