Elegant Machine Learning for Julia


Got errata or suggestions? Email us at info@grox.io

Release Schedule: 2021-03-01 through 2021-05-10

Version: May 10, 2021

Programmer Passport FluxML




The FluxML machine learning library is an umbrella for several different Julia ML libraries. These cutting edge Auto Differentiation libraries mean your models will learn faster with less training, You can use FluxML to solve computer vision problems, classify data, or predict prices based on working examples from the model zoo, and tailor solutions to your own use. FluxML gives you the option of piecing together predefined loss functions, optimizers, activation functions, and model layers or crafting pieces yourself since it is Julia all the way down.

Put them together and you get an environment that’s purpose built for high performance without sacrificing elegance.


The rise of complexity of ML solutions has led to a greater adoption of general purpose languages, but such solutions had to sacrifice either performance or productivity. Julia was created to step into this gap. FluxML makes use of much of the power of Julia. Language features enable Zygote to rapidly compute the gradients that are the heart of ML systems. Processor compilation support for GPUs and TPUs gives FluxML high performance out of the box without any additional support. Julia’s elegant multiple dispatch allows models, otpimizers, and data processing to resemble the math they are based on.

Course Objectives

Groxio courses focus on concepts rather than features. Since Groxio’s audience has more programmers than data scientists, we’ll spend most of our time focusing on breaking through the dense math concepts that are woven through the FluxML documentation to help you build a strong intuition for the concepts behind the curtain.

We’ll start with a FizzBuzz project to demonstrate the concepts of neural networks and FluxML.

When you’re done, you’ll be able to:

  1. Shape your data for FluxML.

  2. Construct layered FluxML models, matching dimensions and including activation functions.

  3. Train a FluxML model to report progress.

  4. Identify the type of ML problems you’re solving, and apply the appropriate FluxML example to problems ranging from home pricing, image detection, classification, and text processing.


Public & Private

1. FluxML: Why Julia?

FluxML is a machine learning library. The Julia Language plays a huge role in its success. In this video, you'll learn why language choice is important, and the role that performance, productivity, and transparency play in the process.

2. Machine Learning Stages

The machine learning (ML) cycle. This video explores the process you'll use in a ML project at a high level. You will learn how to recognize the key elements of the cycle, from modeling, to the training process, and making predictions, and we'll introduce some FluxML code.

3. Machine Learning Math

FluxML models and training depend on several important mathematical concepts. You don't have to learn them all overnight, but you do need to know about them so you have a basic understanding of the concepts at play. This video focuses on math sugar in FluxML.

4. Evaluate and Optimize Stages

The L in ML means learning. The mechanisms under the hood are evaluation and optimization functions. After watching this video, you'll gain a high level understanding of how those concepts work together in a neural net.

5. Explore a Project in the Console

Dissect a FluxML model from the model zoo from the console. The best way to learn coding concepts is to explore code from experienced developers. You'll go through one of the introductory models to see a working FluxML example.

6. FluxML in Pluto Notebooks

Explore a model from the FluxML model zoo from the console. The best way to learn coding concepts is to explore code from experienced developers. The Pluto notebook lets you do so while pausing to enter code as you go.

7. Housing as a Linear Regression

One of the most common data models is a linear regression. Take a basic linear regression and solve it with Flux. Many simple Julia solutions exist, but building and training a Flux model step by step in Pluto will build your intuition for how Dense layers work under the hood.

8. Housing with Flux Abstractions

Rewrite key parts of the housing linear regression example in Pluto to use Flux abstractions for modeling, loss, and training. First, replace the model with an off-the-shelf Dense model. Then, use the MSE Flux loss function to compute mean squared error. Finally, use a classic Flux training loop.

9. ML Math, Simple Data

This video builds the intuition for what's happening in machine learning on the model side. Start with a simple line, and see how tailoring a model works by tailoring the slope and bias constants. That understanding will pay dividends when it's time to solve more sophisticated problems in the future.

10. ML Math, Multidimensional Data

This video picks up the basic linear example, and adds in multidimensional data. See how operators work with multidimensional data. Learn metaphors to help you think through how matrix multiplication works, and how the dimensions will impact each layer of the solution. Then, see how Flux manages dimensions across layers.

11. Gradients and AutoDiff

FluxML relies on a technique called AutoDiff that uses differential equations in the context of machine learning problems. We'll build on your intuition of what a gradient is, and in later videos we'll use these gradients to solve machine learning problems.

12. Apply Gradients in an Optimizer

As it build abstractions one on top of the next, FluxML uses gradients as part of a training process to tweak the parameters of a ML objective function, called loss. In this video, we apply gradients as part of an optimizer called Gradient Descent.

13. Apply Gradients By Hand

Rather than relying on the FluxML train! function, we apply gradients by hand to the weights and biases of a single-layer, single-dimensional model. The problem improves the loss one step at a time, reducing loss and improving predictions.

14. Apply Gradients to a Multilayer Problem

A perceptron is a neural network that classifies a set of inputs. In this video, we build a perceptron for a XOR gate and use that model to show the individual changes that Flux makes with AutoDiff within a neural network.

Julia, Flux, and AD - Chris Rackauckas

In this short video Bruce Tate, author of Seven More Languages in Seven Weeks and Groxio founder, interviews Chris Rackauckas, builder of the scientific machine learning FluxML library for the Julia Language.

15. Julia, FluxML, and Loss Functions

Loss functions define the distance from a prediction to a training or test observation. Picking a good loss function can help your models converge faster, and give your predictions better characteristics. Groxio shows you how to pick one.

16. Julia, FluxML, and Activation Functions

Activation functions in FluxML and other machine learning libraries let models make sophisticated, nonlinear predictions. This video shows an example of a prediction that won't converge without a good activation function.

Community Resources

Cool quick trips for FluxML

Learn It

These resources will get you on the path to learning with background information, tooling and exercises.

Do It

You decide how deep to go. These resources are exercises and projects to cement your learning.

Grok It

These resources will help you put your new knowledge into context so you'll be better at your everyday job.


Longer Excursions (chapters 3 and 4)