-
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
1ecf443
commit 89d120b
Showing
7 changed files
with
42 additions
and
2 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
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
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
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
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,23 @@ | ||
open Smolgrad.Variable | ||
open Smolgrad.Network | ||
|
||
let test_neural_network_initialization () = | ||
let nn = Network.create 3 [5; 2; 3] in | ||
|
||
Alcotest.(check int) | ||
"Network: Number of layers are expected" | ||
3 | ||
(List.length (Network.parameters nn)); | ||
;; | ||
|
||
let test_neural_network_propagation_of_input () = | ||
let nn = Network.create 3 [5; 2; 6] in | ||
let input_vector = [Variable.create 3.0; Variable.create 2.0; Variable.create 1.0] in | ||
let output_vector = Network.propagate_input nn input_vector in | ||
|
||
(* the dimension of the output vector should be equal to the number of neurons in the last layer *) | ||
Alcotest.(check int) | ||
"Network: Output vector has the expected number of dimensions" | ||
6 | ||
(List.length output_vector); | ||
;; |
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
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