-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d2030c
commit 5279475
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(* chapter 1 *) | ||
let line x params = | ||
match params with | ||
| [a; b] -> | ||
(a *. x) +. b | ||
| _ -> | ||
failwith "only accept #params = 2" | ||
|
||
let line_xs = Tensor.floats [2.0; 1.0; 4.0; 3.0] | ||
|
||
let line_ys = Tensor.floats [1.8; 1.2; 4.2; 3.3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters