Clastify logo
Subjects
Features
Review
HOT
Tutoring

A4.1: Machine learning fundamentals

Master IB Computer Science A4.1: Machine learning fundamentals with notes created by examiners and strictly aligned with the syllabus.

This content can't be printed from the browser. Use Export PDF with Pro for an offline copy.

IB Syllabus Requirements for Machine learning fundamentals

A4.1.1

Machine learning approaches and applications

A4.1.2

Hardware for machine learning

A4.1.1

MACHINE LEARNING APPROACHES AND APPLICATIONS

Describe each approach by explaining what the system learns from, how it learns and what the resulting model can do. These approaches aren't mutually exclusive: a single system can combine several.

Learning from examples, patterns or rewards

Machine learning uses data or experience to develop models that identify patterns and produce outputs. A programmer doesn't have to specify a rule for every possible input.

ApproachHow learning happensDistinctive characteristic
Supervised learningA model learns from examples that pair input features with known target outputs, called labels.Training examples show the answers the model should produce.
Unsupervised learning (UL)A model examines input data without supplied target outputs.It finds structure, such as groups of similar examples or associations between items.
Reinforcement learning (RL)An agent takes actions in an environment and receives rewards or penalties.Rather than receiving a correct answer for each action, it learns a strategy for choosing actions that increases cumulative reward.
The figure contrasts the signals used for learning. Supervised learning uses labelled examples; unsupervised learning works with unlabelled data. Reinforcement learning instead uses feedback from interaction.

Working through a small data set

In an invented orchard, colour and firmness measurements are used to classify fruit as ready or not ready for picking. A feature is an input characteristic used by a model; a label is the target output supplied with a training example.

FruitColourFirmnessLabel
AGreenHardNot ready
BGreenHardNot ready
COrangeSoftReady
DOrangeSoftReady

For supervised learning, colour and firmness are the inputs, while the readiness label supplies the target. The examples link green, hard fruit to “Not ready” and orange, soft fruit to “Ready”. Given a new orange, soft fruit, a model that has learned this pattern would predict “Ready”. That illustrates prediction from labelled examples. It does not establish how reliably the model handles other fruit.

Remove the readiness labels for unsupervised learning. The model could group A with B and C with D because their features match. It has found similarity, but no one has taught it that either group means “Ready”.

A different orchard task suits reinforcement learning: teaching a mobile robot to navigate between trees. Here, the robot is the agent and the orchard is its environment. Its actions include moving and turning. Feedback rewards progress towards a destination and penalizes collisions. Since actions affect later situations, the robot must learn a useful sequence of decisions rather than merely select an immediately rewarding move.

Deep learning and transfer learning

Deep learning (DL) uses neural networks with multiple layers that learn increasingly complex representations of their inputs. An image model, for example, can learn simple visual patterns in earlier layers, then combinations of those patterns in later layers.

For object detection and classification, a deep learning system could locate fruit in orchard images and identify its type. Learning these visual features from examples reduces the need to hand-design every feature. Training, though, can require substantial data, processing and memory.

Transfer learning (TL) adapts a model previously trained on one task for use on a related task. Instead of being trained entirely from the beginning, a model that already recognizes general visual features could be adapted using labelled images of a new fruit variety.

Reusing learned features can reduce the amount of new data and training time needed. How useful this is depends on the relevance of the earlier learning to the new task.

These approaches describe different aspects of a system. In the figure, an orchard image model uses deep learning as its model approach. It also uses supervised learning through labelled fruit images and transfer learning through an existing trained model.

Matching an approach to an application

For object detection and classification, labelled images show what to locate and identify. Deep learning can learn complex image features, while transfer learning can reuse useful features from earlier training. In robotics navigation, reinforcement learning can connect movement decisions to their longer-term consequences. Machine learning has other applications too; the appropriate approach depends on the available data, the feedback and the intended output.

Key terms: supervised learning, unsupervised learning (UL), reinforcement learning (RL), deep learning (DL), transfer learning (TL), object detection and classification, robotics navigation.

A4.1.2

HARDWARE FOR MACHINE LEARNING

To describe a suitable hardware configuration, link the workload to the processing, storage and scalability it needs. A small model used occasionally on a laptop needs different hardware from a large model trained across many machines. A model running inside a mobile robot has different requirements again.

What determines the configuration?

Training develops a model from data; inference uses a trained model to produce outputs from new inputs. Training often takes much more computation than a single inference. Serving many inference requests, though, can also create a large workload.

Three factors guide the hardware choice:

  • Processing: how much computation is needed and what type, how quickly the system must respond, and whether many operations can run in parallel.
  • Storage: enough capacity to hold data sets, trained models and intermediate results, with sufficient speed to deliver data to the processor. Working memory must also accommodate the active workload.
  • Scalability: the ability to handle growth in data, model size or request volume by increasing the resources available.
The figure connects these factors to hardware selection. A powerful processor is not enough on its own: the model must fit in memory, and data must reach the processor quickly enough.

From standard laptops to specialized hardware

HardwareRelevant characteristicsSuitable deployment and limitations
Standard laptopProvides general-purpose processing with local memory and storage; some models also have a GPU.Suits small data sets, modest training workloads and local inference. Memory, processing capacity and cooling limit the size of the workload it can handle.
Graphics processing unit (GPU)Runs many similar numerical operations in parallel and has its own working memory.Useful for deep learning training and high-volume inference. Available GPU memory limits model size, and power requirements can be substantial.
Application-specific integrated circuit (ASIC)A chip designed for a particular task or narrow class of tasks.Can process a well-defined workload efficiently, but its specialized design makes it less flexible than general-purpose hardware.
Tensor processing unit (TPU)A specialized ASIC designed to accelerate tensor operations used in machine learning.Suits compatible large machine learning workloads. The benefits depend on how effectively the model and software can use its supported operations.
Field-programmable gate array (FPGA)Hardware with logic that can be configured after manufacture.Can implement customized, low-latency processing. It can be reconfigured as requirements change, though configuration requires specialist expertise.
Edge deviceProcesses data near where it is collected, often with tight limits on power, memory and storage.Suits local inference in equipment such as a mobile robot. It reduces communication delays and dependence on connectivity, but limits model size and processing capacity.

These categories overlap. A TPU is a type of ASIC; an edge device may contain a specialized accelerator. Describe hardware by its processing technology as well as its deployment role.

Cloud-based platforms and HPC centres

Cloud-based platforms provide processing and storage resources that users access remotely. Users can obtain CPUs, GPUs or other accelerators without owning the physical machines. They can also increase or decrease their allocated capacity as demand changes.

Cloud resources suit changing demand or a temporary need for substantial training capacity. There are trade-offs. Large data sets take time and bandwidth to transfer, remote access relies on connectivity, and using the resources incurs ongoing costs.

High-performance computing (HPC) centres combine powerful computing systems with large storage resources and high-speed interconnections. They support demanding workloads, which may be distributed across multiple processors or machines.

For very large training tasks, an HPC centre can supply the processing and storage needed. How effectively those resources can be used depends on whether the workload can be divided across them. Shared access may also mean scheduling delays. Cloud platforms can offer access to HPC-style resources, so the two are not necessarily separate alternatives.

Matching hardware to deployment scenarios

These configurations show how processing, storage and scalability requirements lead to different hardware choices.

ScenarioSuitable configurationReasoning
An orchard researcher experiments with a small fruit-readiness data set.Standard laptop with local memory and storage.The workload is modest. Advanced infrastructure would add unnecessary complexity and expense.
An orchard trains a large deep learning model on fruit images.GPUs or compatible TPUs accessed through a cloud-based platform or HPC centre, with substantial memory and storage.Parallel processing speeds up numerical work, while storage holds the images and models. Additional resources can support larger workloads where the training process allows it.
A mobile orchard robot must respond promptly while connectivity is unreliable.Edge device with local model storage and sufficient processing capacity; an ASIC or FPGA may accelerate inference.Processing locally avoids waiting for a remote response. The model must fit the device's memory and power constraints.
A remote image-classification service faces changing request volumes.Cloud-based platform with scalable processing and storage.Capacity can grow with demand, but communication delays and continuing costs must be considered.
The figure contrasts two connected stages. First comes large-scale training on GPUs or TPUs through a cloud-based platform or HPC centre, followed by local inference on an edge device. The trained model is transferred between them. The edge device does not need to repeat the full training workload.

Key terms: processing, storage, scalability, application-specific integrated circuits (ASICs), edge devices, field-programmable gate arrays (FPGAs), GPUs, tensor processing units (TPUs), cloud-based platforms, high-performance computing (HPC) centres.

Were those notes helpful?

A4.2 Data preprocessing