From 19b8a858fa348d13b49ed1d56ece8e2cce30436e Mon Sep 17 00:00:00 2001 From: itsubaki <1759459+itsubaki@users.noreply.github.com> Date: Sat, 2 Mar 2024 13:23:46 +0900 Subject: [PATCH] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index fb1a0e5..8293150 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,21 @@ ## Example +### function + +```go +x := variable.New(1.0) +y := F.Sin(x) +y.Backward() + +fmt.Println(y) +fmt.Println(x.Grad) + +// Output: +// variable([0.8414709848078965]) +// variable([0.5403023058681398]) +``` + ### Composite function ```go