SlideShare a Scribd company logo
1 of 20
Download to read offline
20
The Machine Learning Package
Nov. 2023, Max Kleiner
 MLP as Package with out of the box demos
 IDE / RAD / CLI / Shell / Scripts
 CIFAR-10 Image Classifier
 https://github.com/maxkleiner/neural-api
 This session shows you various ways of using
the MLP in your application.
maXbox4exe
Digital unterschrieben
von maXbox4exe
Datum: 2023.08.15
17:45:46 +02'00'
2 / 20
Agenda
 Artificial Neural Networks (ANNs) in a Delphi
Form as a Component.
 ML Package for Delphi and Lazarus.
 CIFAR-10 Image Classifier
 Loading and testing a pre-trained model
 In the archive MachineLearningPackage.zip you find the
script, model and data you need, which works with
Lazarus, Delphi, Jupyter and maXbox.
3 / 20
NN Research
 Neural networks are composed of a large
number of interconnected units divided into
input, output, and hidden nodes. A single
processing unit merely sums up the weighted
activation on its inputs, transforms this sum
according to an activation function, and passes
the resulting function to its output.
 https://www.kau.edu.sa/Files/320/Researches/52692_22998.pdf
 https://entwickler-konferenz.de/blog/machine-learning-mit-cai/
4 / 20
Cross-platform ANN component
 Defining the Network Structure.
 Initialization (structure).
 Specifying minimum and maximum values for
inputs and outputs.
 Training data (with loss function).
 After Training testing.
 Using the Trained Network
https://github.com/maxkleiner/maXbox/blob/master/logisticregression2.ipynb
5 / 20
Defining NN Structure
 To define structure of a network run-time, just add following lines:
 nn1.Network.clear;
 nn1.Network.Add('2'); // Number of inputs
 nn1.Network.Add('3'); // Number of hidden neurons
 nn1.Network.Add('2');
 nn1.Network.Add('1'); // Num. of outputs
 Nn1.Initialize(true); // Initialize neural network
Row 1 Row 2 Row 3 Row 4
0
2
4
6
8
10
12
Column 1
Column 2
Column 3
6 / 20
Be aware of
Demo: 1234_NeuralNetwork2_XOR_test12_EKON27.pas
7 / 20
Graph Control
8 / 20
Flow & Graph Control II
Demo: 1234_NeuralNetwork2_XOR_sampleEU_EKON27.pas
9 / 20
ML Package
 IDE for Console or Terminal
10 / 20
MLP
 The neural-api or CAI API (Conscious Artificial
Intelligence) is
 something like TensorFlow for Pascal and is platform-
independent open source
 library for artificial intelligence or machine learning in the field of
 speech recognition, image classification, OpenCL, big data,
data science, sentiment-analysis
 and computer vision2 with more or less SVG.
https://github.com/maxkleiner/neural-api/
11 / 20
Using MLP
 To be able to run this example, you'll need to load an already
trained neural network file and then select the image you intend to
classify.
 TRAINPATH = '.modelClassifyCNNResize40_84.nn'
 CAI stores both architecture and weights into the same *.nn file!
 Dropout is a simple and powerful regularization technique for neural
networks and deep learning models.
 Download the package:
https://github.com/maxkleiner/neural-api/blob/master/examples/SimpleImageClassifier/MachineLearningPackage.zip
 Just unpack the zip and start exe
12 / 20
Let's compile
 As the name implies, it is a CNN-model. A Convolutional1 Neural
Network (CNN) is a type of deep learning algorithm that is particularly
for image recognition and object-detection tasks. It is made up of
multiple layers, including convolution layers, pooling layers, and fully
connected layers.
 Const PICPATH = '.data';
 TRAINPATH = '.modelClassifyCNNModel_70.nn';
 The main procedure to classify incoming images loads the
model, decides dropout or not (later more) and creates input-
and output-volumes with a shape of 32;32;3 or a 32x32x3
volume:
 Demo: 1135_classify_cifar10images1_5.pas
13 / 20
The Main
Loading 10K images from file "C:Program
FilesStreamingmaxbox4maxbox47590maxbox4cifar-10-batches-bintest_batch.bin" ...
GLOBAL MIN MAX -2 1.984375
Testbatch size: 48000000
dbug volumescount: 10000
Ver: 4.7.6.50 (476). Workdir: C:Program
FilesStreamingmaxbox4maxbox47590maxbox4resizedMLPackage
Testbatch score: Rate:0.8000, Loss:-0.0639, ErrorSum:467.7171
14 / 20
Pretrained
 The *.nn file in TRAINPATH serves as a pre-trained file (FAvgWeight)
to classify/predict images we trained on. Also the CIFAR-10 with
experiments/testcnnalgo/testcnnalgo.lpr and a number of CIFAR-10
classification examples are available on /experiments.

 Imagine the accuracy goes up and the loss-function (error-rate) goes down.
The loss function is the bread & butter of modern machine learning; it takes
your algorithm from theoretical to practical and transforms matrix
multiplication into deep learning.
15 / 20
Electron Web App
 Unit classify_cifar10_images2lazTutor42_1_61;
https://wiki.freepascal.org/pas2js_Electron_Web_Application
16 / 20
Form Create
17 / 20
Performance
 Loss functions are different based on a problem statement
to which deep learning is being applied. The cost function
is another term used interchangeably for the loss function,
but it holds a more different meaning.
 A loss function is for a single training example, while a cost
function is an average loss over a complete train dataset.
 train neural network start..:15000 iterators, train neural network finished:
 RMS ERROR: 0.004679808474835: evaluate neural network..
 i:0 j:0 0.095534542493845
 i:0 j:1 0.931946667637693
 i:1 j:0 0.914564807733864
 i:1 j:1 0.005510785410457
debug inf nncount:3 mX4 executed: 14/08/2023 09:33:01 Runtime: 0:0:6.1 Memload: 54% use
18 / 20
Web Platforms
 As a Jupyter Notebook:
 https://github.com/maxkleiner/maXbox/blob/master/EKON24_SimpleI
mageClassificationCPU.ipynb
 and the same in Colab.research:
 https://colab.research.google.com/github/maxkleiner/maXbox/blob/ma
ster/EKON24_SimpleImageClassificationCPU.ipynb
https://github.com/maxkleiner/maXbox/blob/master/objectdetector3.ipynb
The whole package with app, script, tutorial, data and model:
https://github.com/maxkleiner/neural-
api/blob/master/examples/SimpleImageClassifier/MachineLearni
ngPackage.zip
19 / 20
Conclusion
 Only CNN is available but diff. structures
possible, implement some of these well known
architectures with CAI:
 For example Yann LeCun LeNet-5:
 NN := TNNet.Create();
 NN.AddLayer( TNNetInput.Create(28, 28, 1) );
NN.AddLayer( TNNetConvolution.Create(6, 5, 0, 1) );
NN.AddLayer( TNNetMaxPool.Create(2) );
NN.AddLayer( TNNetConvolution.Create(16, 5, 0, 1) );
NN.AddLayer( TNNetMaxPool.Create(2) );
NN.AddLayer( TNNetFullConnect.Create(120) );
NN.AddLayer( TNNetFullConnect.Create(84) );
NN.AddLayer( TNNetFullConnectLinear.Create(10) );
NN.AddLayer( TNNetSoftMax.Create() );
https://raw.githack.com/breitsch2/maXbox4/master/assets/graph3.html
Method: Classification
Model: CNN + CIFAR-10
Metric: RMS
20 / 20
MLP
Thanks for coming!
Materials:
http://www.softwareschule.ch/download/maxbox_starter105.pdf
https://github.com/breitsch2/maXbox4/tree/master/assets

More Related Content

Similar to EKON27_MLP_1_sign.pdf

Kostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and KubeflowKostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
IT Arena
 
MLlib sparkmeetup_8_6_13_final_reduced
MLlib sparkmeetup_8_6_13_final_reducedMLlib sparkmeetup_8_6_13_final_reduced
MLlib sparkmeetup_8_6_13_final_reduced
Chao Chen
 

Similar to EKON27_MLP_1_sign.pdf (20)

Introducing Deep learning with Matlab
Introducing Deep learning with MatlabIntroducing Deep learning with Matlab
Introducing Deep learning with Matlab
 
EKON 24 ML_community_edition
EKON 24 ML_community_editionEKON 24 ML_community_edition
EKON 24 ML_community_edition
 
Emulating cisco network laboratory topologies in the cloud
Emulating cisco network laboratory topologies in the cloudEmulating cisco network laboratory topologies in the cloud
Emulating cisco network laboratory topologies in the cloud
 
Training course lect1
Training course lect1Training course lect1
Training course lect1
 
Deep Learning with DL4J on Apache Spark: Yeah it's Cool, but are You Doing it...
Deep Learning with DL4J on Apache Spark: Yeah it's Cool, but are You Doing it...Deep Learning with DL4J on Apache Spark: Yeah it's Cool, but are You Doing it...
Deep Learning with DL4J on Apache Spark: Yeah it's Cool, but are You Doing it...
 
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
Software Frameworks for Deep Learning (D1L7 2017 UPC Deep Learning for Comput...
 
Pitfalls of machine learning in production
Pitfalls of machine learning in productionPitfalls of machine learning in production
Pitfalls of machine learning in production
 
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
 
Automatic License Plate Recognition using OpenCV
Automatic License Plate Recognition using OpenCVAutomatic License Plate Recognition using OpenCV
Automatic License Plate Recognition using OpenCV
 
Automatic License Plate Recognition using OpenCV
Automatic License Plate Recognition using OpenCV Automatic License Plate Recognition using OpenCV
Automatic License Plate Recognition using OpenCV
 
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and KubeflowKostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
 
MLlib sparkmeetup_8_6_13_final_reduced
MLlib sparkmeetup_8_6_13_final_reducedMLlib sparkmeetup_8_6_13_final_reduced
MLlib sparkmeetup_8_6_13_final_reduced
 
NVIDIA深度學習教育機構 (DLI): Object detection with jetson
NVIDIA深度學習教育機構 (DLI): Object detection with jetsonNVIDIA深度學習教育機構 (DLI): Object detection with jetson
NVIDIA深度學習教育機構 (DLI): Object detection with jetson
 
C# Unit 2 notes
C# Unit 2 notesC# Unit 2 notes
C# Unit 2 notes
 
databricks ml flow demonstration using automatic features engineering
databricks ml flow demonstration using automatic features engineeringdatabricks ml flow demonstration using automatic features engineering
databricks ml flow demonstration using automatic features engineering
 
Educating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz TamirEducating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz Tamir
 
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
 
Enhancing Apache Kafka for Large Scale Real-Time Data Pipeline at Tencent | K...
Enhancing Apache Kafka for Large Scale Real-Time Data Pipeline at Tencent | K...Enhancing Apache Kafka for Large Scale Real-Time Data Pipeline at Tencent | K...
Enhancing Apache Kafka for Large Scale Real-Time Data Pipeline at Tencent | K...
 
Microservices Application Tracing Standards and Simulators - Adrians at OSCON
Microservices Application Tracing Standards and Simulators - Adrians at OSCONMicroservices Application Tracing Standards and Simulators - Adrians at OSCON
Microservices Application Tracing Standards and Simulators - Adrians at OSCON
 
Sysml 2019 demo_paper
Sysml 2019 demo_paperSysml 2019 demo_paper
Sysml 2019 demo_paper
 

Recently uploaded

Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
HyderabadDolls
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
HyderabadDolls
 
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get CytotecAbortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 

Recently uploaded (20)

5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction
 
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get CytotecAbortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
Abortion pills in Doha {{ QATAR }} +966572737505) Get Cytotec
 
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service AvailableVastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts ServiceCall Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Introduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptxIntroduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptx
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime GiridihGiridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 

EKON27_MLP_1_sign.pdf

  • 1. 20 The Machine Learning Package Nov. 2023, Max Kleiner  MLP as Package with out of the box demos  IDE / RAD / CLI / Shell / Scripts  CIFAR-10 Image Classifier  https://github.com/maxkleiner/neural-api  This session shows you various ways of using the MLP in your application. maXbox4exe Digital unterschrieben von maXbox4exe Datum: 2023.08.15 17:45:46 +02'00'
  • 2. 2 / 20 Agenda  Artificial Neural Networks (ANNs) in a Delphi Form as a Component.  ML Package for Delphi and Lazarus.  CIFAR-10 Image Classifier  Loading and testing a pre-trained model  In the archive MachineLearningPackage.zip you find the script, model and data you need, which works with Lazarus, Delphi, Jupyter and maXbox.
  • 3. 3 / 20 NN Research  Neural networks are composed of a large number of interconnected units divided into input, output, and hidden nodes. A single processing unit merely sums up the weighted activation on its inputs, transforms this sum according to an activation function, and passes the resulting function to its output.  https://www.kau.edu.sa/Files/320/Researches/52692_22998.pdf  https://entwickler-konferenz.de/blog/machine-learning-mit-cai/
  • 4. 4 / 20 Cross-platform ANN component  Defining the Network Structure.  Initialization (structure).  Specifying minimum and maximum values for inputs and outputs.  Training data (with loss function).  After Training testing.  Using the Trained Network https://github.com/maxkleiner/maXbox/blob/master/logisticregression2.ipynb
  • 5. 5 / 20 Defining NN Structure  To define structure of a network run-time, just add following lines:  nn1.Network.clear;  nn1.Network.Add('2'); // Number of inputs  nn1.Network.Add('3'); // Number of hidden neurons  nn1.Network.Add('2');  nn1.Network.Add('1'); // Num. of outputs  Nn1.Initialize(true); // Initialize neural network Row 1 Row 2 Row 3 Row 4 0 2 4 6 8 10 12 Column 1 Column 2 Column 3
  • 6. 6 / 20 Be aware of Demo: 1234_NeuralNetwork2_XOR_test12_EKON27.pas
  • 7. 7 / 20 Graph Control
  • 8. 8 / 20 Flow & Graph Control II Demo: 1234_NeuralNetwork2_XOR_sampleEU_EKON27.pas
  • 9. 9 / 20 ML Package  IDE for Console or Terminal
  • 10. 10 / 20 MLP  The neural-api or CAI API (Conscious Artificial Intelligence) is  something like TensorFlow for Pascal and is platform- independent open source  library for artificial intelligence or machine learning in the field of  speech recognition, image classification, OpenCL, big data, data science, sentiment-analysis  and computer vision2 with more or less SVG. https://github.com/maxkleiner/neural-api/
  • 11. 11 / 20 Using MLP  To be able to run this example, you'll need to load an already trained neural network file and then select the image you intend to classify.  TRAINPATH = '.modelClassifyCNNResize40_84.nn'  CAI stores both architecture and weights into the same *.nn file!  Dropout is a simple and powerful regularization technique for neural networks and deep learning models.  Download the package: https://github.com/maxkleiner/neural-api/blob/master/examples/SimpleImageClassifier/MachineLearningPackage.zip  Just unpack the zip and start exe
  • 12. 12 / 20 Let's compile  As the name implies, it is a CNN-model. A Convolutional1 Neural Network (CNN) is a type of deep learning algorithm that is particularly for image recognition and object-detection tasks. It is made up of multiple layers, including convolution layers, pooling layers, and fully connected layers.  Const PICPATH = '.data';  TRAINPATH = '.modelClassifyCNNModel_70.nn';  The main procedure to classify incoming images loads the model, decides dropout or not (later more) and creates input- and output-volumes with a shape of 32;32;3 or a 32x32x3 volume:  Demo: 1135_classify_cifar10images1_5.pas
  • 13. 13 / 20 The Main Loading 10K images from file "C:Program FilesStreamingmaxbox4maxbox47590maxbox4cifar-10-batches-bintest_batch.bin" ... GLOBAL MIN MAX -2 1.984375 Testbatch size: 48000000 dbug volumescount: 10000 Ver: 4.7.6.50 (476). Workdir: C:Program FilesStreamingmaxbox4maxbox47590maxbox4resizedMLPackage Testbatch score: Rate:0.8000, Loss:-0.0639, ErrorSum:467.7171
  • 14. 14 / 20 Pretrained  The *.nn file in TRAINPATH serves as a pre-trained file (FAvgWeight) to classify/predict images we trained on. Also the CIFAR-10 with experiments/testcnnalgo/testcnnalgo.lpr and a number of CIFAR-10 classification examples are available on /experiments.   Imagine the accuracy goes up and the loss-function (error-rate) goes down. The loss function is the bread & butter of modern machine learning; it takes your algorithm from theoretical to practical and transforms matrix multiplication into deep learning.
  • 15. 15 / 20 Electron Web App  Unit classify_cifar10_images2lazTutor42_1_61; https://wiki.freepascal.org/pas2js_Electron_Web_Application
  • 16. 16 / 20 Form Create
  • 17. 17 / 20 Performance  Loss functions are different based on a problem statement to which deep learning is being applied. The cost function is another term used interchangeably for the loss function, but it holds a more different meaning.  A loss function is for a single training example, while a cost function is an average loss over a complete train dataset.  train neural network start..:15000 iterators, train neural network finished:  RMS ERROR: 0.004679808474835: evaluate neural network..  i:0 j:0 0.095534542493845  i:0 j:1 0.931946667637693  i:1 j:0 0.914564807733864  i:1 j:1 0.005510785410457 debug inf nncount:3 mX4 executed: 14/08/2023 09:33:01 Runtime: 0:0:6.1 Memload: 54% use
  • 18. 18 / 20 Web Platforms  As a Jupyter Notebook:  https://github.com/maxkleiner/maXbox/blob/master/EKON24_SimpleI mageClassificationCPU.ipynb  and the same in Colab.research:  https://colab.research.google.com/github/maxkleiner/maXbox/blob/ma ster/EKON24_SimpleImageClassificationCPU.ipynb https://github.com/maxkleiner/maXbox/blob/master/objectdetector3.ipynb The whole package with app, script, tutorial, data and model: https://github.com/maxkleiner/neural- api/blob/master/examples/SimpleImageClassifier/MachineLearni ngPackage.zip
  • 19. 19 / 20 Conclusion  Only CNN is available but diff. structures possible, implement some of these well known architectures with CAI:  For example Yann LeCun LeNet-5:  NN := TNNet.Create();  NN.AddLayer( TNNetInput.Create(28, 28, 1) ); NN.AddLayer( TNNetConvolution.Create(6, 5, 0, 1) ); NN.AddLayer( TNNetMaxPool.Create(2) ); NN.AddLayer( TNNetConvolution.Create(16, 5, 0, 1) ); NN.AddLayer( TNNetMaxPool.Create(2) ); NN.AddLayer( TNNetFullConnect.Create(120) ); NN.AddLayer( TNNetFullConnect.Create(84) ); NN.AddLayer( TNNetFullConnectLinear.Create(10) ); NN.AddLayer( TNNetSoftMax.Create() ); https://raw.githack.com/breitsch2/maXbox4/master/assets/graph3.html Method: Classification Model: CNN + CIFAR-10 Metric: RMS
  • 20. 20 / 20 MLP Thanks for coming! Materials: http://www.softwareschule.ch/download/maxbox_starter105.pdf https://github.com/breitsch2/maXbox4/tree/master/assets