Skip to content

Commit 1214161

Browse files
authored
Merge pull request #3 from kamalsaleh/master
The commutative ring of the category of smooth maps is now a dummy field
2 parents 88f5250 + 42f2ed9 commit 1214161

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "MachineLearningForCAP",
1212
Subtitle := "Exploring categorical machine learning in CAP",
13-
Version := "2024.07-09",
13+
Version := "2024.07-10",
1414
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
1515
License := "GPL-2.0-or-later",
1616

gap/CategoryOfSkeletalSmoothMaps.gi

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ InstallValue( MachineLearningForCAP,
1212
InstallGlobalFunction( CategoryOfSkeletalSmoothMaps,
1313

1414
function ( )
15-
local name, Smooth;
15+
local name, Smooth, reals;
1616

1717
name := "SkeletalSmoothMaps";
1818

@@ -31,8 +31,19 @@ InstallGlobalFunction( CategoryOfSkeletalSmoothMaps,
3131
SetIsSymmetricMonoidalCategory( Smooth, true );
3232
SetIsLinearCategoryOverCommutativeRing( Smooth, true );
3333

34-
## Usually we need the field of reals or floats
35-
SetCommutativeRingOfLinearCategory( Smooth, Rationals );
34+
##
35+
36+
reals := DummyField( );
37+
38+
reals!.Name := "Reals";
39+
40+
# or IsFloat
41+
reals!.RingElementFilter := IsRingElement;
42+
43+
# or Float
44+
reals!.interpret_rationals_func := IdFunc;
45+
46+
SetCommutativeRingOfLinearCategory( Smooth, reals );
3647

3748
##
3849
AddObjectConstructor( Smooth,

tst/categorical_vs_direct_constructions.tst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ gap> Assert( 0, Para.QuadraticLoss_( 3 ) = Para.QuadraticLoss( 3 ) );
77
gap> Assert( 0, Para.CrossEntropyLoss_( 3 ) = Para.CrossEntropyLoss( 3 ) );
88
gap> Assert( 0, Para.SoftmaxCrossEntropyLoss_( 3 ) = Para.SoftmaxCrossEntropyLoss( 3 ) );
99
gap> Assert( 0, Para.QuadraticLoss_( 3 ) = Para.QuadraticLoss( 3 ) );
10-
gap> Assert( 0, Para.QuadraticLoss_( 3 ) = Para.QuadraticLoss( 3 ) );
1110
gap> Assert( 0, Para.SigmoidBinaryCrossEntropyLoss_( 1 ) = Para.SigmoidBinaryCrossEntropyLoss( 1 ) );
1211
gap> Assert( 0, Para.AffineTransformation_( 3, 4 ) = Para.AffineTransformation( 3, 4 ) );
1312
gap> Eval( Smooth.PolynomialTransformation( 2, 3, 4 ), [ 1 .. 47 ] );

0 commit comments

Comments
 (0)