Google Colaboratory, or "Colab" as most people call it, is a cloud-based Jupyter notebook environment. It runs in your web browser (you can even run it on your favorite Chromebook) and lets anyone with internet access experiment with machine learning and coding for artificial intelligence. You can write and execute Python code, share your code and edit it simultaneously with other team members, and document everything by combining it into a single notebook with rich text, charts, images, HTML, and LaTeX.

Artificial intelligence and machine learning: A quick primer

Jupyter Logo

You've heard about artificial intelligence (AI) and have probably heard the term machine learning (ML). While AI and ML are often used interchangeably, ML is a subset or subcategory of Artificial Intelligence. Machine learning is one of the tools or pathways to artificial intelligence, using algorithms to learn insights and recognize patterns from data.

A simple explanation of AI is computer hardware that mimics the capabilities of our own computing hardware, the human brain. By using tools like ML, artificial intelligence gains the ability to learn and make decisions without being explicitly programmed on how to make those decisions or being given all the potential outcomes. Essentially, ML takes the approach of letting a computer learn to program itself through its own experience.

If a company currently deploys AI programs, they use machine learning. ML starts with data — huge amounts of data. The controversial subject of AI-generated art is a good example, as it uses data sampling made up of other people's artwork to train the model. Even with all that data, artificial intelligence still can't paint like a human.

If you are a traditional programmer, you know that programming is like writing cooking recipes for a meal. When programming traditionally, you create detailed instructions telling the computer exactly what to do. The computer follows those instructions. If your code is good, it bakes the same cake you made and wrote the recipe for.

Sometimes writing code for a computer to follow isn't possible or would be so time-consuming that the resources aren't available to do it. There are some tasks that humans can do easily but are difficult to program computers to do, like recognizing people's faces, knowing how to make a piece of art look like Van Gogh painted it, or telling the difference between donuts and bagels. Artificial intelligence is mostly capable of doing these things thanks to machine learning.

That's artificial intelligence and machine learning in a nutshell. Machine learning lets AI attempt to figure things out by giving it tons of data to learn from. This takes equally huge amounts of computing power to run tests or practice the most basic code. That's where Google Colab comes in.

Why use Google Colab?

TensorFlow Logo

Google has been aggressive in the field of AI research. Being a company with enormous resources, it can continually experiment and make breakthroughs in the field of Quantum AI. So, it also has a vested interest in the future of these technologies. Google's AI framework, called TensorFlow, was made open source in 2015. This was followed by making Google's development tool, Colaboratory, free for public use in 2017.

You heard that correctly. You have access to these things right now. Making TensorFlow and Google Colab available to the public has made education about and the development of machine learning applications easier. Even if you can't afford the costly computational infrastructure, you can write and execute code today.

The Google Colab workspace app is installed through the Google Workspace Marketplace and integrates with Google Drive. All of your work is stored in Drive or can be loaded from your GitHub. Everything can be shared using the share settings in Google Drive, Docs, and Sheets. Your code is executed in a virtual machine that is private to your account.

Google Colaboratory install in Google Workspace Marketplace

Python and Jupyter can have intensive CPU and GPU workload requirements. Colab gives you free access to computing infrastructure to test and execute your code. Like many of Google's products, there is a free tier and paid options. The free version of Colab is for students, hobbyists, and small experimental projects. As a data scientist or AI researcher, Google's paid plans offer more compute units, faster GPUs, access to higher memory machines, and terminal access with the connected virtual machine.

If you want to learn about artificial intelligence and machine learning or have some simple Python code you want to document or experiment with, Colab requires no setup and is free to use. Google also offers various Colab Pro subscriptions that give paid users access to faster NVIDIA GPUs and compute credits for more advanced tasks.

What can you do in Google Colab?

The Google Colab new notebook screen.

As a programmer, these are some of the things that are possible in Colab:

  • Write, execute, and share code in Python
  • Participate in real-time collaborative coding with your team
  • Connect with GitHub to import or publish notebooks
  • Import external datasets
  • Document code that supports mathematical equations
  • Access GPU and TPU runtimes for free
  • Use preinstalled libraries like TensorFlow, Matplotlib, PlyTorch, and other ML libraries
  • Integrate with GitHub
  • Use version history similar to Google Docs
  • Train models using images, audio, and text
  • Analyze and visualize data

Google Colab vs. Jupyter Notebook

New Google Colab notebook

Google Colab is built on Jupyter Notebook, a fully open source product that's also available for free. Jupyter came first, and IPYNB format notebooks are typically used for data exploration, machine learning experimentation and modeling, documenting code examples, and creating tutorials. Essentially the same things you would do in Google Colab.

So if Google Colab is a way to work with Jupyter Notebooks, what is the difference between using them traditionally or in Google Colab? These are the key differences between the two:

  • Collaboration tools: The most apparent difference comes down to why Google Colab was named Google Colab. Google's platform provides several tools to make team collaboration easier. Besides document sharing and cloud storage, the most important is real-time collaborative coding with other team members.
  • Software: Using Jupyter Notebook traditionally requires software installations on your local hardware. You also need to install your own libraries. Colab works 100% in your web browser, so that is the only software you need, and it's software you already have.
  • Document sharing: Colab notebooks are stored and shared using Google Drive. Like Google Docs and Sheets, your notebooks automatically save periodically, have version history, and can be shared using the same sharing permissions. You can also share your Colab files with anyone without the other person needing to install software to see it.
  • Computing power: Traditional Jupyter Notebooks are stored locally, and code is executed using your local machine's hardware. Even if you have a blazing-fast home computer, it's limited in comparison to the computing power Google Colab gives you access to.

Up your ML game with Google Colab

Artificial intelligence is changing every industry it touches. If you are an aspiring data scientist, a researcher, or are interested in learning about AI, Google Colab lets you play with their toys. In the immediate future, you'll continue seeing the powerful and persuasive subfield of Artificial Intelligence, called machine learning, spread everywhere. Thanks to Google Colab and the Jupyter open source code, you can learn to use these tools from home.

There are some prerequisites before you can code in these environments. You'll need to know the basics of Python and be familiar with GitHub. Colab is a great place to start learning those things as well. There are many guides and tutorials for the different things you can do in Colab, so you can start your learning journey for free.