SlideShare a Scribd company logo
1
ML
Community
Edition
10 Writeln 'Hi AI';
20 Goto 10;
2
Agenda EKON 24
• Tensorflow64 Library
• FANN (Fast Artificial Neural Network )
• CAI NEURAL API
• K-CAI NEURAL API (Jupyter Notebook)
• Installation, Optimisation & Sources
3
Machine Learning
http://docs.codehaus.org/display/SONAR/Plugin+Library
4
Develop for Multiple Devices
https://www.tensorflow.org/
5
• unit tensorflow;
•
• interface
•
• Const
• tensorflow_dll = 'tensorflow64.dll';
•
• Type
• pTFChar = PAnsiChar;
• ppTFChar = ^pTFChar;
• size_t = NativeUInt;
• int64_t = Int64;
• pint64_t = ^int64_t;
• ppint64_t = ^pint64_t;
• psize_t = ^size_t;
• TEnumType = Cardinal;
• Float = Single;
• pFloat = ^Float; Now Demo: TensorFlowTest64.dproj
6
FANN
• Fast Artificial Neural Network (FANN) Library is a free open
source neural network library, which implements multilayer
artificial neural networks in C with support for both fully
connected and sparsely connected networks.
• Cross-platform execution in both fixed and floating point are
supported. It includes a framework for easy handling of
training data sets. It is easy to use, versatile, well
documented, and fast.
• Bindings to more than 15 programming languages are
available.
• https://github.com/libfann/fann
7
Delphi Wrapper
• Fast Artificial Neural Network Library (FANN) v2.2.0
(Original: https://github.com/libfann/fann)
• Fast Artificial Neural Network Library (FANN) v2.2.0
(https://github.com/hatsunearu/fann with FANN_RELU
and FANN_LEAKY_RELU)
• TensorFlow 1.3.0 → Demo
•
https://github.com/Laex/Delphi-Artificial-Neural-Network-Library
•
8
FANN Scripting
NN:= TFannNetwork.create(self)
with NN do begin
Layers.add('2')
Layers.add('3')
Layers.add('1')
LearningRate:= 0.699999988079071100
ConnectionRate:= 1.000
TrainingAlgorithm:= taFANN_TRAIN_RPROP
ActivationFunctionHidden:= afFANN_SIGMOID
ActivationFunctionOutput:= afFANN_SIGMOID
end;
C:maXboxEKON24examples814_FANN_XorSample2.pas
9
CAI NEURAL API
• K-CAI NEURAL API is a Keras based neural
network API for machine learning that will
allow you to prototype with a lots of
possibilities of Tensorflow! Python, Free
Pascal and Delphi together in Google Colab,
Git or the Community Edition.
• https://github.com/joaopauloschuler/neural-api
10
CAI NEURAL API II
• CAI NEURAL API is a pascal based neural
network API optimized for AVX, AVX2 and
AVX512 instruction sets plus OpenCL capable
devices including AMD, Intel and NVIDIA. This
API has been tested under Windows and Linux.
• This project is a subproject from a bigger and
older project called CAI and is sister to Keras
based K-CAI NEURAL API.
https://github.com/joaopauloschuler/neural-api
11
Colab as Universal Platform
Simple Image Classification with any Dataset:
this example shows how to create a model and train it
with a dataset (samples and features) passed as
parameter. Open In Colab
https://colab.research.google.com/github/maxkleiner/maXbox/blob/master/Copy_of_simple_image_classification_with_any_dataset.ipynb
https://colab.research.google.com/github/maxkleiner/
maXbox/blob/master/Copy_of_simple_image_classificat
ion_with_any_dataset.ipynb
12
CIFAR-10 Image Classifier
This example has interesting aspects to look at:
Its source code is very small.
Layers are added sequentially.
Training hyper-parameters are defined before calling fit method.
Model parameters are saved as hdf5 EKONSimpleImageClassifier.nn
https://github.com/maxkleiner/maXbox/blob/master/EKON24_SimpleImageClassificationCPU.ipynb
and the same in colab.research:
https://colab.research.google.com/github/maxkleiner/maXbox/blob/master/EKON24_SimpleImageClassificationCPU.ipynb
13
Win 10 Core Optimisation
CPU or GPU or TPU?
14
Win 32 or 64 API ?
15
Save the model
• Keras separates the concerns of saving your model
architecture and saving your model weights.
• Model weights are saved to HDF5 format. This is a grid
format that is ideal for storing multi-dimensional arrays of
numbers.
•
•Layer 11 Max Output: 0.812 Min Output: 0.000 TNNetSoftMax 10,1,1 Times: 0.00s 0.00s Parent:10
•Starting Testing.
•Epochs: 50 Examples seen:2000000 Test Accuracy: 0.8383 Test Error: 0.4463 Test Loss: 0.4969 Total
time: 162.32min
•Epoch time: 2.7 minutes. 100 epochs: 4.5 hours.
•Epochs: 50. Working time: 2.71 hours.
•Finished.
16
Save files local
• import os
• import urllib.request
• import tarfile
•
• if not os.path.isfile('cifar-10-batches-bin/data_batch_1.bin'):
• print("Downloading CIFAR-10 Files")
• url = 'https://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz'
• urllib.request.urlretrieve(url, './file.tar')
•
• tar = tarfile.open("file.tar")
• tar.extractall()
• tar.close()
17
Finally you can get with git
• C:maXboxmX399100maxbox4maxbox42maxbox4>git clone
https://github.com/joaopau
• loschuler/k-neural-api.git k
• Cloning into 'k'...
• remote: Enumerating objects: 65, done.
• remote: Counting objects: 100% (65/65), done.
• remote: Compressing objects: 100% (43/43), done.
• remote: Total 356 (delta 38), reused 38 (delta 18), pack-reused 291
• Receiving objects: 100% (356/356), 224.47 KiB | 1.57 MiB/s, done.
• Resolving deltas: 100% (225/225), done.
http://docs.codehaus.org/display/SONAR/Developers%27+Seven+Deadly+Sins
18
19
Links & Sources
• Almost all files:
•
• https://sourceforge.net/projects/maxbox/files/Examples/EKON/EKON24/
•
• https://maxbox4.wordpress.com/blog/
•
• https://github.com/maxkleiner/maXbox4/releases
•
20
May the source be with you!
max@kleiner.com
www.softwareschule.ch

More Related Content

PDF
Seattle useR Group - R + Scala
PDF
MLFlow 1.0 Meetup
PDF
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
PPTX
Gc algorithm inside_dot_net
PDF
Apache zeppelin 0.7.0 helium
PPTX
Reuse, Reduce, Recycle in Serverless World
PDF
Apache Spark 2.0: A Deep Dive Into Structured Streaming - by Tathagata Das
PPTX
Flink Forward SF 2017: Eron Wright - Introducing Flink Tensorflow
Seattle useR Group - R + Scala
MLFlow 1.0 Meetup
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Gc algorithm inside_dot_net
Apache zeppelin 0.7.0 helium
Reuse, Reduce, Recycle in Serverless World
Apache Spark 2.0: A Deep Dive Into Structured Streaming - by Tathagata Das
Flink Forward SF 2017: Eron Wright - Introducing Flink Tensorflow

What's hot (20)

PDF
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
PDF
Kubeflow at Spotify (For the Kubeflow Summit)
PPTX
LINE NOW Scratch Card - From Nothing to Production in one month
PPTX
Apache Airflow (incubating) NL HUG Meetup 2016-07-19
PDF
ITSubbotik - как скрестить ежа с ужом или подводные камни внедрения функциона...
PPT
Dotnetintroduce 100324201546-phpapp02
PPTX
Unboxing ML Models... Plus CoreML!
PPT
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
PDF
Apache Zeppelin Helium and Beyond
PPTX
ODSC webinar "Kubeflow, MLFlow and Beyond — augmenting ML delivery" Stepan Pu...
PDF
PharoDAYS 2015: Pharo Status - by Markus Denker
PDF
Fast and Reliable Apache Spark SQL Engine
PDF
Pharo Status ESUG 2014
PDF
Accelerated Machine Learning with RAPIDS and MLflow, Nvidia/RAPIDS
PPTX
Machine Learning Platform in LINE Fukuoka
PPTX
Suneel Marthi - Deep Learning with Apache Flink and DL4J
PDF
Powering machine learning workflows with Apache Airflow and Python
PDF
Continuous Delivery of Deep Transformer-Based NLP Models Using MLflow and AWS...
PDF
Kubeflow repos
PDF
COMPARATIVE STUDY OF MATLAB AND ITS OPEN SOURCE ALTERNATIVE SCILAB
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
Kubeflow at Spotify (For the Kubeflow Summit)
LINE NOW Scratch Card - From Nothing to Production in one month
Apache Airflow (incubating) NL HUG Meetup 2016-07-19
ITSubbotik - как скрестить ежа с ужом или подводные камни внедрения функциона...
Dotnetintroduce 100324201546-phpapp02
Unboxing ML Models... Plus CoreML!
[PyCon 2014 APAC] How to integrate python into a scala stack to build realtim...
Apache Zeppelin Helium and Beyond
ODSC webinar "Kubeflow, MLFlow and Beyond — augmenting ML delivery" Stepan Pu...
PharoDAYS 2015: Pharo Status - by Markus Denker
Fast and Reliable Apache Spark SQL Engine
Pharo Status ESUG 2014
Accelerated Machine Learning with RAPIDS and MLflow, Nvidia/RAPIDS
Machine Learning Platform in LINE Fukuoka
Suneel Marthi - Deep Learning with Apache Flink and DL4J
Powering machine learning workflows with Apache Airflow and Python
Continuous Delivery of Deep Transformer-Based NLP Models Using MLflow and AWS...
Kubeflow repos
COMPARATIVE STUDY OF MATLAB AND ITS OPEN SOURCE ALTERNATIVE SCILAB
Ad

Similar to EKON 24 ML_community_edition (20)

PDF
Neural Networks from Scratch - TensorFlow 101
PDF
"Deep Learning and Vision Algorithm Development in MATLAB Targeting Embedded ...
PPTX
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
PDF
OpenPOWER Workshop in Silicon Valley
PDF
Lecture 4: Deep Learning Frameworks
PDF
maXbox Starter87
PDF
TensorFlow and Keras: An Overview
PPTX
Optimized Feedforward Network of CNN with Xnor Final Presentation
PDF
Austin,TX Meetup presentation tensorflow final oct 26 2017
PDF
Open source ai_technical_trend
PDF
Power ai tensorflowworkloadtutorial-20171117
PDF
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
PDF
EKON27_MLP_1_sign.pdf
PDF
dl-unit-3 materialdl-unit-3 material.pdf
PDF
IRJET- Python Libraries and Packages for Deep Learning-A Survey
PPTX
Image classification using CNN
PDF
Deep Learning Initiative @ NECSTLab
PPTX
Training course lect1
PPTX
Innovation with ai at scale on the edge vt sept 2019 v0
Neural Networks from Scratch - TensorFlow 101
"Deep Learning and Vision Algorithm Development in MATLAB Targeting Embedded ...
Demystifying-AI-Frameworks-TensorFlow-PyTorch-JAX-and-More (1).pptx
OpenPOWER Workshop in Silicon Valley
Lecture 4: Deep Learning Frameworks
maXbox Starter87
TensorFlow and Keras: An Overview
Optimized Feedforward Network of CNN with Xnor Final Presentation
Austin,TX Meetup presentation tensorflow final oct 26 2017
Open source ai_technical_trend
Power ai tensorflowworkloadtutorial-20171117
NumPyCNNAndroid: A Library for Straightforward Implementation of Convolutiona...
EKON27_MLP_1_sign.pdf
dl-unit-3 materialdl-unit-3 material.pdf
IRJET- Python Libraries and Packages for Deep Learning-A Survey
Image classification using CNN
Deep Learning Initiative @ NECSTLab
Training course lect1
Innovation with ai at scale on the edge vt sept 2019 v0
Ad

More from Max Kleiner (20)

PDF
EKON28_ModernRegex_12_Regular_Expressions.pdf
PDF
EKON28_Maps_API_12_google_openstreetmaps.pdf
PDF
EKON26_VCL4Python.pdf
PDF
EKON26_Open_API_Develop2Cloud.pdf
PDF
maXbox_Starter91_SyntheticData_Implement
PDF
Ekon 25 Python4Delphi_MX475
PDF
EKON 25 Python4Delphi_mX4
PDF
maXbox Starter78 PortablePixmap
PDF
maXbox starter75 object detection
PDF
BASTA 2020 VS Code Data Visualisation
PDF
maxbox starter72 multilanguage coding
PDF
EKON 23 Code_review_checklist
PDF
EKON 12 Running OpenLDAP
PDF
EKON 12 Closures Coding
PDF
NoGUI maXbox Starter70
PDF
maXbox starter69 Machine Learning VII
PDF
maXbox starter68 machine learning VI
PDF
maXbox starter67 machine learning V
PDF
maXbox starter65 machinelearning3
PDF
EKON22_Overview_Machinelearning_Diagrams
EKON28_ModernRegex_12_Regular_Expressions.pdf
EKON28_Maps_API_12_google_openstreetmaps.pdf
EKON26_VCL4Python.pdf
EKON26_Open_API_Develop2Cloud.pdf
maXbox_Starter91_SyntheticData_Implement
Ekon 25 Python4Delphi_MX475
EKON 25 Python4Delphi_mX4
maXbox Starter78 PortablePixmap
maXbox starter75 object detection
BASTA 2020 VS Code Data Visualisation
maxbox starter72 multilanguage coding
EKON 23 Code_review_checklist
EKON 12 Running OpenLDAP
EKON 12 Closures Coding
NoGUI maXbox Starter70
maXbox starter69 Machine Learning VII
maXbox starter68 machine learning VI
maXbox starter67 machine learning V
maXbox starter65 machinelearning3
EKON22_Overview_Machinelearning_Diagrams

Recently uploaded (20)

PDF
[EN] Industrial Machine Downtime Prediction
PDF
Microsoft Core Cloud Services powerpoint
PDF
Introduction to the R Programming Language
PDF
Business Analytics and business intelligence.pdf
PPTX
CYBER SECURITY the Next Warefare Tactics
PPT
Predictive modeling basics in data cleaning process
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
DOCX
Factor Analysis Word Document Presentation
PPTX
Leprosy and NLEP programme community medicine
PPTX
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
PDF
Transcultural that can help you someday.
PPTX
importance of Data-Visualization-in-Data-Science. for mba studnts
PDF
Global Data and Analytics Market Outlook Report
PDF
annual-report-2024-2025 original latest.
PPTX
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
PPTX
Introduction to Inferential Statistics.pptx
PDF
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
PPTX
IMPACT OF LANDSLIDE.....................
[EN] Industrial Machine Downtime Prediction
Microsoft Core Cloud Services powerpoint
Introduction to the R Programming Language
Business Analytics and business intelligence.pdf
CYBER SECURITY the Next Warefare Tactics
Predictive modeling basics in data cleaning process
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
Acceptance and paychological effects of mandatory extra coach I classes.pptx
IBA_Chapter_11_Slides_Final_Accessible.pptx
Factor Analysis Word Document Presentation
Leprosy and NLEP programme community medicine
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
Transcultural that can help you someday.
importance of Data-Visualization-in-Data-Science. for mba studnts
Global Data and Analytics Market Outlook Report
annual-report-2024-2025 original latest.
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
Introduction to Inferential Statistics.pptx
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
IMPACT OF LANDSLIDE.....................

EKON 24 ML_community_edition

  • 2. 2 Agenda EKON 24 • Tensorflow64 Library • FANN (Fast Artificial Neural Network ) • CAI NEURAL API • K-CAI NEURAL API (Jupyter Notebook) • Installation, Optimisation & Sources
  • 4. 4 Develop for Multiple Devices https://www.tensorflow.org/
  • 5. 5 • unit tensorflow; • • interface • • Const • tensorflow_dll = 'tensorflow64.dll'; • • Type • pTFChar = PAnsiChar; • ppTFChar = ^pTFChar; • size_t = NativeUInt; • int64_t = Int64; • pint64_t = ^int64_t; • ppint64_t = ^pint64_t; • psize_t = ^size_t; • TEnumType = Cardinal; • Float = Single; • pFloat = ^Float; Now Demo: TensorFlowTest64.dproj
  • 6. 6 FANN • Fast Artificial Neural Network (FANN) Library is a free open source neural network library, which implements multilayer artificial neural networks in C with support for both fully connected and sparsely connected networks. • Cross-platform execution in both fixed and floating point are supported. It includes a framework for easy handling of training data sets. It is easy to use, versatile, well documented, and fast. • Bindings to more than 15 programming languages are available. • https://github.com/libfann/fann
  • 7. 7 Delphi Wrapper • Fast Artificial Neural Network Library (FANN) v2.2.0 (Original: https://github.com/libfann/fann) • Fast Artificial Neural Network Library (FANN) v2.2.0 (https://github.com/hatsunearu/fann with FANN_RELU and FANN_LEAKY_RELU) • TensorFlow 1.3.0 → Demo • https://github.com/Laex/Delphi-Artificial-Neural-Network-Library •
  • 8. 8 FANN Scripting NN:= TFannNetwork.create(self) with NN do begin Layers.add('2') Layers.add('3') Layers.add('1') LearningRate:= 0.699999988079071100 ConnectionRate:= 1.000 TrainingAlgorithm:= taFANN_TRAIN_RPROP ActivationFunctionHidden:= afFANN_SIGMOID ActivationFunctionOutput:= afFANN_SIGMOID end; C:maXboxEKON24examples814_FANN_XorSample2.pas
  • 9. 9 CAI NEURAL API • K-CAI NEURAL API is a Keras based neural network API for machine learning that will allow you to prototype with a lots of possibilities of Tensorflow! Python, Free Pascal and Delphi together in Google Colab, Git or the Community Edition. • https://github.com/joaopauloschuler/neural-api
  • 10. 10 CAI NEURAL API II • CAI NEURAL API is a pascal based neural network API optimized for AVX, AVX2 and AVX512 instruction sets plus OpenCL capable devices including AMD, Intel and NVIDIA. This API has been tested under Windows and Linux. • This project is a subproject from a bigger and older project called CAI and is sister to Keras based K-CAI NEURAL API. https://github.com/joaopauloschuler/neural-api
  • 11. 11 Colab as Universal Platform Simple Image Classification with any Dataset: this example shows how to create a model and train it with a dataset (samples and features) passed as parameter. Open In Colab https://colab.research.google.com/github/maxkleiner/maXbox/blob/master/Copy_of_simple_image_classification_with_any_dataset.ipynb https://colab.research.google.com/github/maxkleiner/ maXbox/blob/master/Copy_of_simple_image_classificat ion_with_any_dataset.ipynb
  • 12. 12 CIFAR-10 Image Classifier This example has interesting aspects to look at: Its source code is very small. Layers are added sequentially. Training hyper-parameters are defined before calling fit method. Model parameters are saved as hdf5 EKONSimpleImageClassifier.nn https://github.com/maxkleiner/maXbox/blob/master/EKON24_SimpleImageClassificationCPU.ipynb and the same in colab.research: https://colab.research.google.com/github/maxkleiner/maXbox/blob/master/EKON24_SimpleImageClassificationCPU.ipynb
  • 13. 13 Win 10 Core Optimisation CPU or GPU or TPU?
  • 14. 14 Win 32 or 64 API ?
  • 15. 15 Save the model • Keras separates the concerns of saving your model architecture and saving your model weights. • Model weights are saved to HDF5 format. This is a grid format that is ideal for storing multi-dimensional arrays of numbers. • •Layer 11 Max Output: 0.812 Min Output: 0.000 TNNetSoftMax 10,1,1 Times: 0.00s 0.00s Parent:10 •Starting Testing. •Epochs: 50 Examples seen:2000000 Test Accuracy: 0.8383 Test Error: 0.4463 Test Loss: 0.4969 Total time: 162.32min •Epoch time: 2.7 minutes. 100 epochs: 4.5 hours. •Epochs: 50. Working time: 2.71 hours. •Finished.
  • 16. 16 Save files local • import os • import urllib.request • import tarfile • • if not os.path.isfile('cifar-10-batches-bin/data_batch_1.bin'): • print("Downloading CIFAR-10 Files") • url = 'https://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz' • urllib.request.urlretrieve(url, './file.tar') • • tar = tarfile.open("file.tar") • tar.extractall() • tar.close()
  • 17. 17 Finally you can get with git • C:maXboxmX399100maxbox4maxbox42maxbox4>git clone https://github.com/joaopau • loschuler/k-neural-api.git k • Cloning into 'k'... • remote: Enumerating objects: 65, done. • remote: Counting objects: 100% (65/65), done. • remote: Compressing objects: 100% (43/43), done. • remote: Total 356 (delta 38), reused 38 (delta 18), pack-reused 291 • Receiving objects: 100% (356/356), 224.47 KiB | 1.57 MiB/s, done. • Resolving deltas: 100% (225/225), done. http://docs.codehaus.org/display/SONAR/Developers%27+Seven+Deadly+Sins
  • 18. 18
  • 19. 19 Links & Sources • Almost all files: • • https://sourceforge.net/projects/maxbox/files/Examples/EKON/EKON24/ • • https://maxbox4.wordpress.com/blog/ • • https://github.com/maxkleiner/maXbox4/releases •
  • 20. 20 May the source be with you! [email protected] www.softwareschule.ch