File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
test/ParallelReverseAutoDiff.Test Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ using ParallelReverseAutoDiff . RMAD ;
2+ using Xunit ;
3+
4+ namespace ParallelReverseAutoDiff . Test
5+ {
6+ public class SineSoftmaxTest
7+ {
8+ [ Fact ]
9+ public void GivenASineSoftmaxOperation_TheRowsAddUpToMoreThanPointEightOnAverage ( )
10+ {
11+ SineSoftmaxOperation op = new SineSoftmaxOperation ( ) ;
12+ List < double > averages = new List < double > ( ) ;
13+ for ( int i = 5 ; i < 1000 ; ++ i )
14+ {
15+ Matrix input = new Matrix ( i , i ) ;
16+ input . Initialize ( InitializationType . Xavier ) ;
17+ var output = op . Forward ( input ) ;
18+ Assert . NotNull ( output ) ;
19+ var sums = output . ToArray ( ) . ToList ( ) . Select ( x => x . Sum ( ) ) . ToList ( ) ;
20+ var average = output . ToArray ( ) . ToList ( ) . Select ( x => x . Sum ( ) ) . Average ( ) ;
21+ Assert . True ( average > 0.8d ) ;
22+ averages . Add ( average ) ;
23+ }
24+ }
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments