Function
Main()
'---- Parameters -------------------
ResolutionSize=5
ViewPortSize=350
'---- Define Canvas ------------------------
Call
CustomUI.Define_Canvas(ViewPortSize,ViewPortSize)
Call
CustomUI.Clear_Canvas
CustomUI.Form_BringToFront
CustomUI.Form_Caption="2D
color mapping using artificial neural network"
'--- Load trained neural network map ---------------
Call
NeuralNet.OpenNN_Once("Sample
2DColorMap - Trained network.vgn")
'---- Draw 2D map
----------------------------------------------
For
y= 0 to ViewPortSize step ResolutionSize
For
x=0 to ViewPortSize step ResolutionSize
'Assign inputs
NeuralNet.InputData(1)=x/ViewPortSize
NeuralNet.InputData(2)=y/ViewPortSize
'Predict
Call
NeuralNet.PredictNN()
'Read outputs
Red=NeuralNet.OutputData(1)*255
Green=NeuralNet.OutputData(2)*255
Blue=NeuralNet.OutputData(3)*255
'Set fill color and draw rectangle
Call
CustomUI.Set_FillColor_byRGB(Red,Green,Blue)
Call
CustomUI.FillRectangle(x,y,ResolutionSize,ResolutionSize)
Next
Next
'--- Finalize CustomUI -----------------
CustomUI.Make_Clone
End Function |