Skip to content

Commit e14e98f

Browse files
committed
test display and latex method for affine transformations
1 parent 295cff4 commit e14e98f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tst/categorical_vs_direct_constructions.tst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,34 @@ gap> Assert( 0, Para.SoftmaxCrossEntropyLoss_( 3 ) = Para.SoftmaxCrossEntropyLos
99
gap> Assert( 0, Para.QuadraticLoss_( 3 ) = Para.QuadraticLoss( 3 ) );
1010
gap> Assert( 0, Para.SigmoidBinaryCrossEntropyLoss_( 1 ) = Para.SigmoidBinaryCrossEntropyLoss( 1 ) );
1111
gap> Assert( 0, Para.AffineTransformation_( 3, 4 ) = Para.AffineTransformation( 3, 4 ) );
12+
gap> l := Para.AffineTransformation( 3, 4 );
13+
^3 ->^4 defined by:
14+
15+
Parameter Object:
16+
-----------------
17+
^16
18+
19+
Parametrised Morphism:
20+
----------------------
21+
^19 ->^4
22+
gap> dummy_input := DummyInputForAffineTransformation( 3, 4, "w", "b", "x" );;
23+
gap> Display( l : dummy_input := dummy_input );
24+
^3 ->^4 defined by:
25+
26+
Parameter Object:
27+
-----------------
28+
^16
29+
30+
Parametrised Morphism:
31+
----------------------
32+
^19 ->^4
33+
34+
‣ w1_1 * x1 + w2_1 * x2 + w3_1 * x3 + b_1
35+
‣ w1_2 * x1 + w2_2 * x2 + w3_2 * x3 + b_2
36+
‣ w1_3 * x1 + w2_3 * x2 + w3_3 * x3 + b_3
37+
‣ w1_4 * x1 + w2_4 * x2 + w3_4 * x3 + b_4
38+
gap> LaTeXOutput( UnderlyingMorphism( l ) : dummy_input := dummy_input );
39+
"\\begin{array}{c}\n\\mathbb{R}^{19}\\rightarrow\\mathbb{R}^{4}\\\\ \n \\hline \\\\ \n \\left( \\begin{array}{l}\nb_{1} + w_{1 1} x_{1} + w_{2 1} x_{2} + w_{3 1} x_{3} \\\\ \n b_{2} + w_{1 2} x_{1} + w_{2 2} x_{2} + w_{3 2} x_{3} \\\\ \n b_{3} + w_{1 3} x_{1} + w_{2 3} x_{2} + w_{3 3} x_{3} \\\\ \n b_{4} + w_{1 4} x_{1} + w_{2 4} x_{2} + w_{3 4} x_{3}\n\\end{array} \\right)\\\\ \n \\\\ \n \\hline \\\\ \n \\left( \\begin{array}{lllllllllllllllllll}\nx_{1} & x_{2} & x_{3} & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & w_{1 1} & w_{2 1} & w_{3 1} \\\\ \n 0 & 0 & 0 & 0 & x_{1} & x_{2} & x_{3} & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & w_{1 2} & w_{2 2} & w_{3 2} \\\\ \n 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & x_{1} & x_{2} & x_{3} & 1 & 0 & 0 & 0 & 0 & w_{1 3} & w_{2 3} & w_{3 3} \\\\ \n 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & x_{1} & x_{2} & x_{3} & 1 & w_{1 4} & w_{2 4} & w_{3 4}\n\\end{array} \\right)\n\\end{array}"
1240
gap> Eval( Smooth.PolynomialTransformation( 2, 3, 4 ), [ 1 .. 47 ] );
1341
[ 122341573, 479204128, 836066683 ]
1442
gap> EvalJacobianMatrix( Smooth.PolynomialTransformation( 2, 3, 4 ), [ 1 .. 47 ] );

0 commit comments

Comments
 (0)