Left alignment for all the tables with markdown formatting

This commit is contained in:
Vijay Janapa Reddi
2024-08-05 08:15:05 -04:00
parent c522ee25d0
commit 271ea3ed57
19 changed files with 168 additions and 152 deletions

View File

@@ -4,13 +4,6 @@ project:
preview:
browser: true
navigate: true
render:
- "*.qmd"
- "contents/*.qmd"
- "contents/*/*.qmd"
- "contents/*/*/*.qmd"
- "contents/*/*/*/*.qmd"
- "contents/*/*/*/*/*.qmd" # contents/labs/<vendor>/<board>/<exercises>/*.qmd
website:
announcement:
@@ -73,117 +66,117 @@ book:
- part: FRONT MATTER
chapters:
- index.qmd
# - contents/dedication.qmd
# - contents/acknowledgements/acknowledgements.qmd
# - contents/contributors.qmd
# - contents/copyright.qmd
# - contents/about.qmd
# - text: "---"
# - part: MAIN
# - part: Fundamentals
# chapters:
# - contents/introduction/introduction.qmd
# - contents/ml_systems/ml_systems.qmd
# - contents/dl_primer/dl_primer.qmd
# - part: Workflow
# chapters:
# - contents/workflow/workflow.qmd
# - contents/data_engineering/data_engineering.qmd
# - contents/frameworks/frameworks.qmd
# - part: Training
# chapters:
# - contents/training/training.qmd
# - contents/efficient_ai/efficient_ai.qmd
# - contents/optimizations/optimizations.qmd
# - contents/hw_acceleration/hw_acceleration.qmd
# - part: Deployment
# chapters:
# - contents/benchmarking/benchmarking.qmd
# - contents/ondevice_learning/ondevice_learning.qmd
# - contents/ops/ops.qmd
# - part: Advanced Topics
# chapters:
# - contents/privacy_security/privacy_security.qmd
# - contents/responsible_ai/responsible_ai.qmd
# - contents/sustainable_ai/sustainable_ai.qmd
# - contents/robust_ai/robust_ai.qmd
# - contents/generative_ai/generative_ai.qmd
# - part: Social Impact
# chapters:
# - contents/ai_for_good/ai_for_good.qmd
# - part: Closing
# chapters:
# - contents/conclusion/conclusion.qmd
# - text: "---"
# # LABS
# - part: LABS
# # getting started
# chapters:
# - contents/labs/labs.qmd
# - contents/labs/getting_started.qmd
# # nicla vision
# - part: contents/labs/arduino/nicla_vision/nicla_vision.qmd
# chapters:
# - contents/labs/arduino/nicla_vision/setup/setup.qmd
# - contents/labs/arduino/nicla_vision/image_classification/image_classification.qmd
# - contents/labs/arduino/nicla_vision/object_detection/object_detection.qmd
# - contents/labs/arduino/nicla_vision/kws/kws.qmd
# - contents/labs/arduino/nicla_vision/motion_classification/motion_classification.qmd
# # xiao sense
# - part: contents/labs/seeed/xiao_esp32s3/xiao_esp32s3.qmd
# chapters:
# - contents/labs/seeed/xiao_esp32s3/setup/setup.qmd
# - contents/labs/seeed/xiao_esp32s3/image_classification/image_classification.qmd
# - contents/labs/seeed/xiao_esp32s3/object_detection/object_detection.qmd
# - contents/labs/seeed/xiao_esp32s3/kws/kws.qmd
# - contents/labs/seeed/xiao_esp32s3/motion_classification/motion_classification.qmd
# - part: contents/labs/shared/shared.qmd
# chapters:
# - contents/labs/shared/kws_feature_eng/kws_feature_eng.qmd
# - contents/labs/shared/dsp_spectral_features_block/dsp_spectral_features_block.qmd
# - text: "---"
# # REFERENCES
# - part: REFERENCES
# chapters:
# - references.qmd
# - text: "---"
# appendices:
# - contents/tools.qmd
# - contents/zoo_datasets.qmd
# - contents/zoo_models.qmd
# - contents/learning_resources.qmd
# - contents/community.qmd
# - contents/case_studies.qmd
- contents/dedication.qmd
- contents/acknowledgements/acknowledgements.qmd
- contents/contributors.qmd
- contents/copyright.qmd
- contents/about.qmd
- text: "---"
- part: MAIN
- part: Fundamentals
chapters:
- contents/introduction/introduction.qmd
- contents/ml_systems/ml_systems.qmd
- contents/dl_primer/dl_primer.qmd
- part: Workflow
chapters:
- contents/workflow/workflow.qmd
- contents/data_engineering/data_engineering.qmd
- contents/frameworks/frameworks.qmd
- part: Training
chapters:
- contents/training/training.qmd
- contents/efficient_ai/efficient_ai.qmd
- contents/optimizations/optimizations.qmd
- contents/hw_acceleration/hw_acceleration.qmd
- part: Deployment
chapters:
- contents/benchmarking/benchmarking.qmd
- contents/ondevice_learning/ondevice_learning.qmd
- contents/ops/ops.qmd
- part: Advanced Topics
chapters:
- contents/privacy_security/privacy_security.qmd
- contents/responsible_ai/responsible_ai.qmd
- contents/sustainable_ai/sustainable_ai.qmd
- contents/robust_ai/robust_ai.qmd
- contents/generative_ai/generative_ai.qmd
- part: Social Impact
chapters:
- contents/ai_for_good/ai_for_good.qmd
- part: Closing
chapters:
- contents/conclusion/conclusion.qmd
- text: "---"
# LABS
- part: LABS
# getting started
chapters:
- contents/labs/labs.qmd
- contents/labs/getting_started.qmd
# nicla vision
- part: contents/labs/arduino/nicla_vision/nicla_vision.qmd
chapters:
- contents/labs/arduino/nicla_vision/setup/setup.qmd
- contents/labs/arduino/nicla_vision/image_classification/image_classification.qmd
- contents/labs/arduino/nicla_vision/object_detection/object_detection.qmd
- contents/labs/arduino/nicla_vision/kws/kws.qmd
- contents/labs/arduino/nicla_vision/motion_classification/motion_classification.qmd
# xiao sense
- part: contents/labs/seeed/xiao_esp32s3/xiao_esp32s3.qmd
chapters:
- contents/labs/seeed/xiao_esp32s3/setup/setup.qmd
- contents/labs/seeed/xiao_esp32s3/image_classification/image_classification.qmd
- contents/labs/seeed/xiao_esp32s3/object_detection/object_detection.qmd
- contents/labs/seeed/xiao_esp32s3/kws/kws.qmd
- contents/labs/seeed/xiao_esp32s3/motion_classification/motion_classification.qmd
- part: contents/labs/shared/shared.qmd
chapters:
- contents/labs/shared/kws_feature_eng/kws_feature_eng.qmd
- contents/labs/shared/dsp_spectral_features_block/dsp_spectral_features_block.qmd
- text: "---"
# REFERENCES
- part: REFERENCES
chapters:
- references.qmd
- text: "---"
appendices:
- contents/tools.qmd
- contents/zoo_datasets.qmd
- contents/zoo_models.qmd
- contents/learning_resources.qmd
- contents/community.qmd
- contents/case_studies.qmd
# citation: true
citation: true
# license: CC-BY-NC-SA
license: CC-BY-NC-SA
# filters:
# - custom_callout.lua
filters:
- custom_callout.lua
# bibliography:
# # main
# - contents/introduction/introduction.bib
# - contents/ai_for_good/ai_for_good.bib
# - contents/benchmarking/benchmarking.bib
# - contents/data_engineering/data_engineering.bib
# - contents/dl_primer/dl_primer.bib
# - contents/efficient_ai/efficient_ai.bib
# - contents/ml_systems/ml_systems.bib
# - contents/frameworks/frameworks.bib
# - contents/generative_ai/generative_ai.bib
# - contents/hw_acceleration/hw_acceleration.bib
# - contents/ondevice_learning/ondevice_learning.bib
# - contents/ops/ops.bib
# - contents/optimizations/optimizations.bib
# - contents/privacy_security/privacy_security.bib
# - contents/responsible_ai/responsible_ai.bib
# - contents/robust_ai/robust_ai.bib
# - contents/sustainable_ai/sustainable_ai.bib
# - contents/training/training.bib
# - contents/workflow/workflow.bib
# - contents/conclusion/conclusion.bib
bibliography:
# main
- contents/introduction/introduction.bib
- contents/ai_for_good/ai_for_good.bib
- contents/benchmarking/benchmarking.bib
- contents/data_engineering/data_engineering.bib
- contents/dl_primer/dl_primer.bib
- contents/efficient_ai/efficient_ai.bib
- contents/ml_systems/ml_systems.bib
- contents/frameworks/frameworks.bib
- contents/generative_ai/generative_ai.bib
- contents/hw_acceleration/hw_acceleration.bib
- contents/ondevice_learning/ondevice_learning.bib
- contents/ops/ops.bib
- contents/optimizations/optimizations.bib
- contents/privacy_security/privacy_security.bib
- contents/responsible_ai/responsible_ai.bib
- contents/robust_ai/robust_ai.bib
- contents/sustainable_ai/sustainable_ai.bib
- contents/training/training.bib
- contents/workflow/workflow.bib
- contents/conclusion/conclusion.bib
comments:
giscus:
@@ -223,9 +216,12 @@ format:
- darkly
- style.scss
- style-dark.scss
table:
classes: [table-striped, table-hover]
reference-location: margin
citation-location: margin
citeproc: true
sidenote: true # Enable sidenotes for Tufte style
linkcolor: "#A51C30"
urlcolor: "#A51C30"
@@ -251,6 +247,8 @@ format:
<script src="/scripts/ai_menu/dist/384.bundle.js" defer></script>
<script src="/scripts/ai_menu/dist/761.bundle.js" defer></script>
citeproc: true
pdf:
biblio-title: "References"
cite-method: citeproc

View File

@@ -4,5 +4,5 @@ email:
info: mailto:vj@eecs.harvard.edu?subject="CS249r%20MLSys%20with%20TinyML%20Book%20-%20"
title:
long: "Machine Learning Systems with TinyML"
long: "Machine Learning Systems"
short: "Machine Learning Systems"

View File

@@ -231,7 +231,7 @@ Let us learn about synthetic data generation using Generative Adversarial Networ
Data sourcing and data storage go hand in hand, and data must be stored in a format that facilitates easy access and processing. Depending on the use case, various kinds of data storage systems can be used to store your datasets. Some examples are shown in @tbl-databases.
| **Database** | **Data Warehouse** | **Data Lake** |
|------------------------------------|--------------------------|------------------------|
|:------------------------------------|:--------------------------|:------------------------|
| **Purpose** | Operational and transactional | Analytical |
| **Data type** | Structured | Structured, semi-structured, and/or unstructured |
| **Scale** | Small to large volumes of data | Large volumes of integrated data | Large volumes of diverse data |

View File

@@ -232,7 +232,7 @@ These architectures serve specific purposes and excel in different domains, offe
Deep learning extends traditional machine learning by utilizing neural networks to discern patterns in data. In contrast, traditional machine learning relies on a set of established algorithms such as decision trees, k-nearest neighbors, and support vector machines, but does not involve neural networks. To briefly highlight the differences, @tbl-mlvsdl illustrates the contrasting characteristics between traditional ML and deep learning:
| Aspect | Traditional ML | Deep Learning |
|----------------------------|-----------------------------------------------------|--------------------------------------------------------|
|:----------------------------|:-----------------------------------------------------|:--------------------------------------------------------|
| Data Requirements | Low to Moderate (efficient with smaller datasets) | High (requires large datasets for nuanced learning) |
| Model Complexity | Moderate (suitable for well-defined problems) | High (detects intricate patterns, suited for complex tasks) |
| Computational Resources | Low to Moderate (cost-effective, less resource-intensive) | High (demands substantial computational power and resources) |

View File

@@ -119,7 +119,7 @@ By retaining the 8-bit exponent of FP32, BF16 offers a similar range, which is c
Efficient numerics is not just about reducing the bit-width of numbers but understanding the trade-offs between accuracy and efficiency. As machine learning models become more pervasive, especially in real-world, resource-constrained environments, the focus on efficient numerics will continue to grow. By thoughtfully selecting and leveraging the appropriate numeric precision, one can achieve robust model performance while optimizing for speed, memory, and energy. @tbl-precision summarizes these trade-offs.
| Precision | Pros | Cons |
|------------|-----------------------------------------------------------|--------------------------------------------------|
|:------------|:-----------------------------------------------------------|:--------------------------------------------------|
| **FP32** (Floating Point 32-bit) | Standard precision used in most deep learning frameworks.<br/> High accuracy due to ample representational capacity.<br/> Well-suited for training | High memory usage.<br/> Slower inference times compared to quantized models.<br/> Higher energy consumption. |
| **FP16** (Floating Point 16-bit) | Reduces memory usage compared to FP32.<br/> Speeds up computations on hardware that supports FP16.<br/> Often used in mixed-precision training to balance speed and accuracy. | Lower representational capacity compared to FP32.<br/> Risk of numerical instability in some models or layers. |
| **INT8** (8-bit Integer) | Significantly reduced memory footprint compared to floating-point representations.<br/> Faster inference if hardware supports INT8 computations.<br/> Suitable for many post-training quantization scenarios. | Quantization can lead to some accuracy loss.<br/> Requires careful calibration during quantization to minimize accuracy degradation. |

View File

@@ -191,7 +191,7 @@ PyTorch and TensorFlow have established themselves as frontrunners in the indust
@tbl-pytorch_vs_tf provides a comparative analysis:
| Aspect | PyTorch | TensorFlow |
|-----------------------------|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
|:-----------------------------|:------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------|
| Design Philosophy | Dynamic computational graph (eager execution) | Static computational graph (early versions); Eager execution in TensorFlow 2.0 |
| Deployment | Traditionally challenging; Improved with TorchScript & TorchServe | Scalable, especially on embedded platforms with TensorFlow Lite |
| Performance & Optimization | Efficient GPU acceleration | Robust optimization with XLA compiler |
@@ -490,7 +490,7 @@ Edge AI frameworks are tailored to deploy AI models on IoT devices, smartphones,
TinyML frameworks are specialized for deploying AI models on extremely resource-constrained devices, specifically microcontrollers and sensors within the IoT ecosystem. TinyML frameworks are designed for devices with limited resources, emphasizing minimal memory and power consumption. TinyML frameworks are specialized for use cases on resource-constrained IoT devices for predictive maintenance, gesture recognition, and environmental monitoring applications. Major TinyML frameworks include TensorFlow Lite Micro, uTensor, and ARM NN. They optimize complex models to fit within kilobytes of memory through techniques like quantization-aware training and reduced precision. TinyML allows intelligent sensing across battery-powered devices, enabling collaborative learning via federated learning. The choice of framework involves balancing model performance and computational constraints of the target platform, whether cloud, edge, or TinyML. @tbl-ml_frameworks compares the major AI frameworks across cloud, edge, and TinyML environments:
| Framework Type | Examples | Key Technologies | Use Cases |
|----------------|-----------------------------------|-------------------------------------------------------------------------|------------------------------------------------------|
|:----------------|:-----------------------------------|:-------------------------------------------------------------------------|:------------------------------------------------------|
| Cloud AI | TensorFlow, PyTorch, MXNet, Keras | GPUs, TPUs, distributed training, AutoML, MLOps | Cloud services, web apps, big data analytics |
| Edge AI | TensorFlow Lite, PyTorch Mobile, Core ML | Model optimization, compression, quantization, efficient NN architectures | Mobile apps, robots, autonomous systems, real-time processing |
| TinyML | TensorFlow Lite Micro, uTensor, ARM NN | Quantization-aware training, reduced precision, neural architecture search | IoT sensors, wearables, predictive maintenance, gesture recognition |
@@ -578,7 +578,7 @@ Machine learning deployment on microcontrollers and other embedded devices often
@tbl-compare_frameworks summarizes the key differences and similarities between these three specialized machine-learning inference frameworks for embedded systems and microcontrollers.
| Framework | TensorFlow Lite Micro | TinyEngine | CMSIS-NN |
|------------------------|:----------------------------:|:--------------------------------------:|:--------------------------------------:|
|:------------------------|:----------------------------:|:--------------------------------------:|:--------------------------------------:|
| **Approach** | Interpreter-based | Static compilation | Optimized neural network kernels |
| **Hardware Focus** | General embedded devices | Microcontrollers | ARM Cortex-M processors |
| **Arithmetic Support** | Floating point | Floating point, fixed point | Floating point, fixed point |

View File

@@ -17,7 +17,7 @@ These labs provide a unique opportunity to gain practical experience with machin
## Exercises
| **Modality** | **Task** | **Description** | **Link** |
|--------------|--------------|-----------------|----------|
|:--------------|:--------------|:-----------------|:----------|
| Vision | Image Classification | Learn to classify images | [Link](./image_classification/image_classification.qmd) |
| Vision | Object Detection | Implement object detection | [Link](./object_detection/object_detection.qmd) |
| Sound | Keyword Spotting | Explore voice recognition systems | [Link](./kws/kws.qmd) |

View File

@@ -5,7 +5,7 @@ The labs in this section cover topics and techniques that are applicable across
By exploring these shared labs, you'll gain a deeper understanding of the common challenges and solutions in embedded machine learning. The knowledge and skills acquired here will be valuable regardless of the specific hardware you work with in the future.
| Exercise | Nicla Vision | XIAO ESP32S3 |
|------------------------------|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
|:------------------------------|:--------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------|
| KWS Feature Engineering | ✔ [Link](./kws_feature_eng/kws_feature_eng.qmd) | ✔ [Link](./kws_feature_eng/kws_feature_eng.qmd) |
| DSP Spectral Features Block | ✔ [Link](./dsp_spectral_features_block/dsp_spectral_features_block.qmd) | ✔ [Link](./dsp_spectral_features_block/dsp_spectral_features_block.qmd) |

View File

@@ -40,17 +40,6 @@ ML began with Cloud ML, where powerful servers in the cloud were used to train a
![From cloud GPUs to microcontrollers: Navigating the memory and storage landscape across computing devices. Source: [@lin2023tiny]](./images/jpg/cloud_mobile_tiny_sizes.jpg){#fig-vMLsizes}
<!-- ```{r}
#| label: fig-vMLsizes
#| fig-cap: "From cloud GPUs to microcontrollers: Navigating the memory and storage landscape across computing devices. Source: @lin2023tiny."
#| fig-cap-location: margin
#| echo: false
#| warning: FALSE
#| message: FALSE
knitr::include_graphics("./images/jpg/cloud_mobile_tiny_sizes.jpg")
``` -->
## Cloud ML
Cloud ML leverages powerful servers in the cloud for training and running large, complex ML models, and relies on internet connectivity.
@@ -305,8 +294,8 @@ In summary, TinyML serves as a trailblazer in the evolution of machine learning,
Up to this point, we've explored each of the different ML variants individually. Now, let's bring them all together for a comprehensive view. @tbl-big_vs_tiny offers a comparative analysis of Cloud ML, Edge ML, and TinyML based on various features and aspects. This comparison aims to provide a clear perspective on the unique advantages and distinguishing factors, aiding in making informed decisions based on the specific needs and constraints of a given application or project.
| Feature/Aspect | Cloud ML | Edge ML | TinyML |
|--------------------------|--------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|
| Aspect | Cloud ML | Edge ML | TinyML |
|:--------------------------|:--------------------------------------------------------|:------------------------------------------------------|:------------------------------------------------------|
| **Processing Location** | Centralized servers (Data Centers) | Local devices (closer to data sources) | On-device (microcontrollers, embedded systems) |
| **Latency** | High (Depends on internet connectivity) | Moderate (Reduced latency compared to Cloud ML) | Low (Immediate processing without network delay) |
| **Data Privacy** | Moderate (Data transmitted over networks) | High (Data remains on local networks) | Very High (Data processed on-device, not transmitted) |

View File

@@ -357,7 +357,7 @@ By leveraging these different types of transfer learning, practitioners can choo
@tbl-tltypes presents a matrix that outlines in a bit more detail the similarities and differences between the types of transfer learning:
| | Inductive Transfer Learning | Transductive Transfer Learning | Unsupervised Transfer Learning |
|------------------------------|-----------------------------|--------------------------------|---------------------------------|
|:------------------------------|:-----------------------------|:--------------------------------|:---------------------------------|
| **Labeled Data for Target Task** | Required | Not Required | Not Required |
| **Source Task** | Can be different | Same | Same or Different |
| **Target Task** | Can be different | Same | Can be different |
@@ -562,7 +562,7 @@ To mitigate these risks, several defenses can be employed:
By understanding the potential risks and implementing these defenses, we can help secure on-device training at the endpoint/edge and mitigate the impact of adversarial attacks. Most people easily confuse data poisoning and adversarial attacks. So @tbl-attacks compares data poisoning and adversarial attacks:
| Aspect | Data Poisoning | Adversarial Attacks |
|--------------------|-----------------------------------------|-------------------------------------------|
|:--------------------|:-----------------------------------------|:-------------------------------------------|
| **Timing** | Training phase | Inference phase |
| **Target** | Training data | Input data |
| **Goal** | Negatively affect model's performance | Cause incorrect predictions |

View File

@@ -80,7 +80,7 @@ While DevOps and MLOps share similarities in their goals and principles, they di
@tbl-mlops compares and summarizes them side by side.
| Aspect | DevOps | MLOps |
|----------------------|----------------------------------|--------------------------------------|
|:----------------------|:----------------------------------|:--------------------------------------|
| **Objective** | Streamlining software development and operations processes | Optimizing the lifecycle of machine learning models |
| **Methodology** | Continuous Integration and Continuous Delivery (CI/CD) for software development | Similar to CI/CD but focuses on machine learning workflows |
| **Primary Tools** | Version control (Git), CI/CD tools (Jenkins, Travis CI), Configuration management (Ansible, Puppet) | Data versioning tools, Model training and deployment tools, CI/CD pipelines tailored for ML |
@@ -868,7 +868,7 @@ The hypertension case clearly shows the need to look beyond training and deployi
@tbl-clinical_ops compares them. This table highlights how, when MLOps is implemented, we need to consider more than just ML models.
| | Traditional MLOps | ClinAIOps |
|-|-------------------|------------------|
|-|:-------------------|:------------------|
| Focus | ML model development and deployment | Coordinating human and AI decision-making |
| Stakeholders | Data scientists, IT engineers | Patients, clinicians, AI developers |
| Feedback loops | Model retraining, monitoring | Patient-AI, clinician-AI, patient-clinician |

View File

@@ -150,7 +150,7 @@ Unstructured pruning, while offering the potential for significant model size re
@tbl-pruning_methods provides a concise comparison between structured and unstructured pruning. In this table, aspects related to the nature and architecture of the pruned model (Definition, Model Regularity, and Compression Level) are grouped together, followed by aspects related to computational considerations (Computational Efficiency and Hardware Compatibility), and ending with aspects related to the implementation and adaptation of the pruned model (Implementation Complexity and Fine-Tuning Complexity). Both pruning strategies offer unique advantages and challenges, as shown in @tbl-pruning_methods, and the selection between them should be influenced by specific project and deployment requirements.
| **Aspect** | **Structured Pruning** | **Unstructured Pruning** |
|------------------------------|------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
|:------------------------------|:------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------|
| **Definition** | Pruning entire structures (e.g., neurons, channels, layers) within the network | Pruning individual weights or neurons, resulting in sparse matrices or non-regular network structures |
| **Model Regularity** | Maintains a regular, structured network architecture | Results in irregular, sparse network architectures |
| **Compression Level** | May offer limited model compression compared to unstructured pruning | Can achieve higher model compression due to fine-grained pruning |
@@ -401,7 +401,7 @@ Precision, delineating the exactness with which a number is represented, bifurca
**Integer:** Integer representations are made using 8, 4, and 2 bits. They are often used during the inference phase of neural networks, where the weights and activations of the model are quantized to these lower precisions. Integer representations are deterministic and offer significant speed and memory advantages over floating-point representations. For many inference tasks, especially on edge devices, the slight loss in accuracy due to quantization is often acceptable given the efficiency gains. An extreme form of integer numerics is for binary neural networks (BNNs), where weights and activations are constrained to one of two values: either +1 or -1.
| **Precision** | **Pros** | **Cons** |
|---------------------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
|:---------------------------------------|:------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------|
| **FP32** (Floating Point 32-bit) | Standard precision used in most deep learning frameworks.<br> High accuracy due to ample representational capacity.<br> Well-suited for training. | High memory usage.<br> Slower inference times compared to quantized models.<br> Higher energy consumption. |
| **FP16** (Floating Point 16-bit) | Reduces memory usage compared to FP32.<br> Speeds up computations on hardware that supports FP16.<br> Often used in mixed-precision training to balance speed and accuracy. | Lower representational capacity compared to FP32.<br> Risk of numerical instability in some models or layers. |
| **INT8** (8-bit Integer) | Significantly reduced memory footprint compared to floating-point representations.<br> Faster inference if hardware supports INT8 computations.<br> Suitable for many post-training quantization scenarios. | Quantization can lead to some accuracy loss.<br> Requires careful calibration during quantization to minimize accuracy degradation. |
@@ -664,7 +664,7 @@ Quantization-Aware Training serves as a natural extension of Post-Training Quant
![Relative accuracies of PTQ and QAT. Source: @wu2020integer.](images/png/efficientnumerics_PTQQATsummary.png){#fig-quantization-methods-summary}
| **Aspect** | **Post Training Quantization** | **Quantization-Aware Training** | **Dynamic Quantization** |
|------------------------------|------------------------------|------------------------------|------------------------------|
|:------------------------------|:------------------------------|:------------------------------|:------------------------------|
| **Pros** | | | |
| Simplicity | ✓ | ✗ | ✗ |
| Accuracy Preservation | ✗ | ✓ | ✓ |

View File

@@ -334,7 +334,7 @@ In this Colab, play the role of an AI fault detective! You'll build an autoencod
@tbl-fault_types provides an extensive comparative analysis of transient, permanent, and intermittent faults. It outlines the primary characteristics or dimensions that distinguish these fault types. Here, we summarize the relevant dimensions we examined and explore the nuances that differentiate transient, permanent, and intermittent faults in greater detail.
| Dimension | Transient Faults | Permanent Faults | Intermittent Faults |
|-----------|------------------|------------------|---------------------|
|:-----------|:------------------|:------------------|:---------------------|
| Duration | Short-lived, temporary | Persistent, remains until repair or replacement | Sporadic, appears and disappears intermittently |
| Persistence | Disappears after the fault condition passes | Consistently present until addressed | Recurs irregularly, not always present |
| Causes | External factors (e.g., electromagnetic interference, cosmic rays) | Hardware defects, physical damage, wear-out | Unstable hardware conditions, loose connections, aging components |
@@ -402,7 +402,7 @@ Physical-world attacks bring adversarial examples into the realm of real-world s
@tbl-attack_types a concise overview of the different categories of adversarial attacks, including gradient-based attacks (FGSM, PGD, JSMA), optimization-based attacks (C&W, EAD), transfer-based attacks, and physical-world attacks (adversarial patches and objects). Each attack is briefly described, highlighting its key characteristics and mechanisms.
| Attack Category | Attack Name | Description |
|-----------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------|
|:-----------------------|:-------------------------------------|:-----------------------------------------------------------------------------------------------------------------|
| Gradient-based | Fast Gradient Sign Method (FGSM) | Perturbs input data by adding small noise in the gradient direction to maximize prediction error. |
| | Projected Gradient Descent (PGD) | Extends FGSM by iteratively applying the gradient update step for more refined adversarial examples. |
| | Jacobian-based Saliency Map Attack (JSMA) | Identifies influential input features and perturbs them to create adversarial examples. |

View File

@@ -7,7 +7,7 @@ This is a non-exhaustive list of tools and frameworks that are available for emb
### **Microcontrollers and Development Boards**
| No | Hardware | Processor | Features | TinyML Compatibility |
|----|------------------------------|--------------------------------|---------------------------------------------------------|-------------------------------------------------|
|:----|:------------------------------|:--------------------------------|:---------------------------------------------------------|:-------------------------------------------------|
| 1 | Arduino Nano 33 BLE Sense | ARM Cortex-M4 | Onboard sensors, Bluetooth connectivity | TensorFlow Lite Micro |
| 2 | Raspberry Pi Pico | Dual-core Arm Cortex-M0+ | Low-cost, large community support | TensorFlow Lite Micro |
| 3 | SparkFun Edge | Ambiq Apollo3 Blue | Ultra-low power consumption, onboard microphone | TensorFlow Lite Micro |
@@ -23,7 +23,7 @@ This is a non-exhaustive list of tools and frameworks that are available for emb
### **Machine Learning Frameworks**
| No | Machine Learning Framework | Description | Use Cases |
|----|---------------------------|--------------------------------------------------------------------------------|------------------------------------------|
|:----|:---------------------------|:--------------------------------------------------------------------------------|:------------------------------------------|
| 1 | TensorFlow Lite | Lightweight library for running machine learning models on constrained devices | Image recognition, voice commands, anomaly detection |
| 2 | Edge Impulse | A platform providing tools for creating machine learning models optimized for edge devices | Data collection, model training, deployment on tiny devices |
| 3 | ONNX Runtime | A performance-optimized engine for running ONNX models, fine-tuned for edge devices | Cross-platform deployment of machine learning models |
@@ -31,14 +31,14 @@ This is a non-exhaustive list of tools and frameworks that are available for emb
### **Libraries and APIs**
| No | Library/API | Description | Use Cases |
|----|-------------|------------------------------------------------------------------------------------------------------|------------------------------------------|
|:----|:-------------|:------------------------------------------------------------------------------------------------------|:------------------------------------------|
| 1 | CMSIS-NN | A collection of efficient neural network kernels optimized for Cortex-M processors | Embedded vision and AI applications |
| 2 | ARM NN | An inference engine for CPUs, GPUs, and NPUs, enabling the translation of neural network frameworks | Accelerating machine learning model inference on ARM-based devices |
## IDEs and Development Environments
| No | IDE/Development Environment | Description | Features |
|----|------------------------------|------------------------------------------------------------------------------------|----------------------------------------------------|
|:----|:------------------------------|:------------------------------------------------------------------------------------|:----------------------------------------------------|
| 1 | PlatformIO | An open-source ecosystem for IoT development catering to various boards & platforms | Cross-platform build system, continuous testing, firmware updates |
| 2 | Eclipse Embedded CDT | A plugin for Eclipse facilitating embedded systems development | Supports various compilers and debuggers, integrates with popular build tools |
| 3 | Arduino IDE | Official development environment for Arduino supporting various boards & languages | User-friendly interface, large community support, extensive library collection |

View File

@@ -1061,7 +1061,7 @@ However, as the model parts run on physically separate devices, they must commun
To summarize, `@tbl-parallelism` demonstrates some of the key characteristics for comparing data parallelism and model parallelism:
| Characteristic | Data Parallelism | Model Parallelism |
|----------------------|----------------------------------------------------|--------------------------------------|
|:----------------------|:----------------------------------------------------|:--------------------------------------|
| Definition | Distribute data across devices with model replicas | Distribute model across devices |
| Objective | Accelerate training through compute scaling | Enable larger model training |
| Scaling Method | Scale devices/workers | Scale model size |

View File

@@ -85,7 +85,7 @@ Creating an ML solution, especially for embedded AI, is a multidisciplinary effo
@tbl-mlops_roles shows a rundown of the typical roles involved:
| Role | Responsibilities |
|--------------------------------|----------------------------------------------------------------------------------------------------|
|:--------------------------------|:----------------------------------------------------------------------------------------------------|
| Project Manager | Oversees the project, ensuring timelines and milestones are met. |
| Domain Experts | Offer domain-specific insights to define project requirements. |
| Data Scientists | Specialize in data analysis and model development. |

0
index.acn Normal file
View File

0
index.glo Normal file
View File

29
index.ist Normal file
View File

@@ -0,0 +1,29 @@
% makeindex style file created by the glossaries package
% for document 'index' on 2024-8-5
actual '?'
encap '|'
level '!'
quote '"'
keyword "\\glossaryentry"
preamble "\\glossarysection[\\glossarytoctitle]{\\glossarytitle}\\glossarypreamble\n\\begin{theglossary}\\glossaryheader\n"
postamble "\%\n\\end{theglossary}\\glossarypostamble\n"
group_skip "\\glsgroupskip\n"
item_0 "\%\n"
item_1 "\%\n"
item_2 "\%\n"
item_01 "\%\n"
item_x1 "\\relax \\glsresetentrylist\n"
item_12 "\%\n"
item_x2 "\\relax \\glsresetentrylist\n"
delim_0 "\{\\glossaryentrynumbers\{\\relax "
delim_1 "\{\\glossaryentrynumbers\{\\relax "
delim_2 "\{\\glossaryentrynumbers\{\\relax "
delim_t "\}\}"
delim_n "\\delimN "
delim_r "\\delimR "
headings_flag 1
heading_prefix "\\glsgroupheading\{"
heading_suffix "\}\\relax \\glsresetentrylist "
symhead_positive "glssymbols"
numhead_positive "glsnumbers"
page_compositor "."