Skip to content

Commit

Permalink
Small fix on the visual autoencoder.#109
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopauloschuler committed Mar 4, 2023
1 parent 502e3b7 commit 541a803
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions examples/VisualAutoencoder/uvisualautoencodertinyimagenet.pas
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ procedure TFormVisualLearning.Learn( Sender: TObject);
TNNetConvolution.Create({Features=}32 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}1,{SuppressBias=}1),
TNNetConvolution.Create({Features=}32 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}2,{SuppressBias=}1), //16x16
TNNetConvolution.Create({Features=}32 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}1,{SuppressBias=}1),
TNNetConvolution.Create({Features=}64 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}2,{SuppressBias=}0), //8x8
TNNetConvolution.Create({Features=}64 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}1,{SuppressBias=}0),
TNNetConvolution.Create({Features=}64 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}2,{SuppressBias=}1), //8x8
TNNetConvolution.Create({Features=}64 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}1,{SuppressBias=}1),
TNNetConvolution.Create({Features=}128 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}2,{SuppressBias=}1), //4x4
TNNetConvolution.Create({Features=}128 * NeuronMultiplier,{FeatureSize=}3,{Padding=}1,{Stride=}1,{SuppressBias=}1),

Expand All @@ -276,8 +276,6 @@ procedure TFormVisualLearning.Learn( Sender: TObject);
FAutoencoder.LoadFromFile(FBaseName+'autoencoder.nn');
end;
FAutoencoder.DebugStructure();
FAutoencoder.SetLearningRate(0.001,0.9);
FAutoencoder.SetL2Decay(0.0);

FFit.OnAfterEpoch := @Self.AutoencoderOnAfterEpoch;
FFit.OnAfterStep := @Self.AutoencoderOnAfterStep;
Expand All @@ -296,7 +294,7 @@ procedure TFormVisualLearning.Learn( Sender: TObject);
FAutoencoder.EnableOpenCL(FEasyOpenCL.PlatformIds[0], FEasyOpenCL.Devices[0]);
end;
{$endif}
//Debug only: FFit.MaxThreadNum := 2;
//Debug only: FFit.MaxThreadNum := 1;
FFit.FitLoading(FAutoencoder, {EpochSize=}FTrainImages.CountElements(), 0, 0, {Batch=}64, {Epochs=}35000, @GetTrainingData, nil, nil); // This line does the same as above

FAutoencoder.Free;
Expand Down

0 comments on commit 541a803

Please sign in to comment.