@@ -63,12 +63,12 @@ public static class DatasetLoader
63
63
[ PublicAPI ]
64
64
[ Pure , NotNull ]
65
65
[ CollectionAccess ( CollectionAccessType . Read ) ]
66
- public static ITrainingDataset Training < TPixel > ( [ NotNull ] IEnumerable < ( String X , float [ ] Y ) > data , int size , ImageNormalizationMode normalization , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
66
+ public static ITrainingDataset Training < TPixel > ( [ NotNull ] IEnumerable < ( string X , float [ ] Y ) > data , int size , ImageNormalizationMode normalization , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
67
67
where TPixel : struct , IPixel < TPixel >
68
68
{
69
69
return BatchesCollection . From ( modifiers . Length > 0
70
70
? data . SelectMany ( xy => modifiers . Select < Action < IImageProcessingContext < TPixel > > , Func < ( float [ ] , float [ ] ) > > ( f => ( ) => ( ImageLoader . Load ( xy . X , normalization , f ) , xy . Y ) ) )
71
- : data . Select < ( String X , float [ ] Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ) ) , size ) ;
71
+ : data . Select < ( string X , float [ ] Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ) ) , size ) ;
72
72
}
73
73
74
74
/// <summary>
@@ -83,12 +83,12 @@ public static ITrainingDataset Training<TPixel>([NotNull] IEnumerable<(String X,
83
83
[ PublicAPI ]
84
84
[ Pure , NotNull ]
85
85
[ CollectionAccess ( CollectionAccessType . Read ) ]
86
- public static ITrainingDataset Training < TPixel > ( [ NotNull ] IEnumerable < ( String X , Func < float [ ] > Y ) > data , int size , ImageNormalizationMode normalization , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
86
+ public static ITrainingDataset Training < TPixel > ( [ NotNull ] IEnumerable < ( string X , Func < float [ ] > Y ) > data , int size , ImageNormalizationMode normalization , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
87
87
where TPixel : struct , IPixel < TPixel >
88
88
{
89
89
return BatchesCollection . From ( modifiers . Length > 0
90
90
? data . SelectMany ( xy => modifiers . Select < Action < IImageProcessingContext < TPixel > > , Func < ( float [ ] , float [ ] ) > > ( f => ( ) => ( ImageLoader . Load ( xy . X , normalization , f ) , xy . Y ( ) ) ) )
91
- : data . Select < ( String X , Func < float [ ] > Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ( ) ) ) , size ) ;
91
+ : data . Select < ( string X , Func < float [ ] > Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ( ) ) ) , size ) ;
92
92
}
93
93
94
94
#endregion
@@ -144,13 +144,13 @@ public static IValidationDataset Validation([NotNull, ItemNotNull] IEnumerable<F
144
144
[ Pure , NotNull ]
145
145
[ CollectionAccess ( CollectionAccessType . Read ) ]
146
146
public static IValidationDataset Validation < TPixel > (
147
- [ NotNull ] IEnumerable < ( String X , float [ ] Y ) > data , float tolerance = 1e-2f , int epochs = 5 ,
147
+ [ NotNull ] IEnumerable < ( string X , float [ ] Y ) > data , float tolerance = 1e-2f , int epochs = 5 ,
148
148
ImageNormalizationMode normalization = ImageNormalizationMode . Sigmoid , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
149
149
where TPixel : struct , IPixel < TPixel >
150
150
{
151
151
return Validation ( ( modifiers . Length > 0
152
152
? data . SelectMany ( xy => modifiers . Select < Action < IImageProcessingContext < TPixel > > , Func < ( float [ ] , float [ ] ) > > ( f => ( ) => ( ImageLoader . Load ( xy . X , normalization , f ) , xy . Y ) ) )
153
- : data . Select < ( String X , float [ ] Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ) ) ) . AsParallel ( ) , tolerance , epochs ) ;
153
+ : data . Select < ( string X , float [ ] Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ) ) ) . AsParallel ( ) , tolerance , epochs ) ;
154
154
}
155
155
156
156
/// <summary>
@@ -167,13 +167,13 @@ public static IValidationDataset Validation<TPixel>(
167
167
[ Pure , NotNull ]
168
168
[ CollectionAccess ( CollectionAccessType . Read ) ]
169
169
public static IValidationDataset Validation < TPixel > (
170
- [ NotNull ] IEnumerable < ( String X , Func < float [ ] > Y ) > data , float tolerance = 1e-2f , int epochs = 5 ,
170
+ [ NotNull ] IEnumerable < ( string X , Func < float [ ] > Y ) > data , float tolerance = 1e-2f , int epochs = 5 ,
171
171
ImageNormalizationMode normalization = ImageNormalizationMode . Sigmoid , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
172
172
where TPixel : struct , IPixel < TPixel >
173
173
{
174
174
return Validation ( ( modifiers . Length > 0
175
175
? data . SelectMany ( xy => modifiers . Select < Action < IImageProcessingContext < TPixel > > , Func < ( float [ ] , float [ ] ) > > ( f => ( ) => ( ImageLoader . Load ( xy . X , normalization , f ) , xy . Y ( ) ) ) )
176
- : data . Select < ( String X , Func < float [ ] > Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ( ) ) ) ) . AsParallel ( ) , tolerance , epochs ) ;
176
+ : data . Select < ( string X , Func < float [ ] > Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ( ) ) ) ) . AsParallel ( ) , tolerance , epochs ) ;
177
177
}
178
178
179
179
#endregion
@@ -225,13 +225,13 @@ public static ITestDataset Test([NotNull, ItemNotNull] IEnumerable<Func<(float[]
225
225
[ Pure , NotNull ]
226
226
[ CollectionAccess ( CollectionAccessType . Read ) ]
227
227
public static ITestDataset Test < TPixel > (
228
- [ NotNull ] IEnumerable < ( String X , float [ ] Y ) > data , [ CanBeNull ] Action < TrainingProgressEventArgs > progress = null
228
+ [ NotNull ] IEnumerable < ( string X , float [ ] Y ) > data , [ CanBeNull ] Action < TrainingProgressEventArgs > progress = null
229
229
, ImageNormalizationMode normalization = ImageNormalizationMode . Sigmoid , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
230
230
where TPixel : struct , IPixel < TPixel >
231
231
{
232
232
return Test ( ( modifiers . Length > 0
233
233
? data . SelectMany ( xy => modifiers . Select < Action < IImageProcessingContext < TPixel > > , Func < ( float [ ] , float [ ] ) > > ( f => ( ) => ( ImageLoader . Load ( xy . X , normalization , f ) , xy . Y ) ) )
234
- : data . Select < ( String X , float [ ] Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ) ) ) . AsParallel ( ) , progress ) ;
234
+ : data . Select < ( string X , float [ ] Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ) ) ) . AsParallel ( ) , progress ) ;
235
235
}
236
236
237
237
/// <summary>
@@ -247,13 +247,13 @@ public static ITestDataset Test<TPixel>(
247
247
[ Pure , NotNull ]
248
248
[ CollectionAccess ( CollectionAccessType . Read ) ]
249
249
public static ITestDataset Test < TPixel > (
250
- [ NotNull ] IEnumerable < ( String X , Func < float [ ] > Y ) > data , [ CanBeNull ] Action < TrainingProgressEventArgs > progress = null ,
250
+ [ NotNull ] IEnumerable < ( string X , Func < float [ ] > Y ) > data , [ CanBeNull ] Action < TrainingProgressEventArgs > progress = null ,
251
251
ImageNormalizationMode normalization = ImageNormalizationMode . Sigmoid , [ NotNull , ItemNotNull ] params Action < IImageProcessingContext < TPixel > > [ ] modifiers )
252
252
where TPixel : struct , IPixel < TPixel >
253
253
{
254
254
return Test ( ( modifiers . Length > 0
255
255
? data . SelectMany ( xy => modifiers . Select < Action < IImageProcessingContext < TPixel > > , Func < ( float [ ] , float [ ] ) > > ( f => ( ) => ( ImageLoader . Load ( xy . X , normalization , f ) , xy . Y ( ) ) ) )
256
- : data . Select < ( String X , Func < float [ ] > Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ( ) ) ) ) . AsParallel ( ) , progress ) ;
256
+ : data . Select < ( string X , Func < float [ ] > Y ) , Func < ( float [ ] , float [ ] ) > > ( xy => ( ) => ( ImageLoader . Load < TPixel > ( xy . X , normalization , null ) , xy . Y ( ) ) ) ) . AsParallel ( ) , progress ) ;
257
257
}
258
258
259
259
#endregion
0 commit comments