If you want to create a machine learning model but say you don`t have a computer that can handle the load, Google Colab — this is the platform for you. Even if you have a GPU or a good computer, create a local environment with anaconda, install packages and troubleshoot installation problems — not an easy task.
Colab Laboratory — it is a free Jupyter laptop environment provided by Google where you can use free GPUs and TPUs that can solve all these problems.
To get started with Colab, you first need log into your google account and then follow this link https://colab.research.google.com .
Opening Jupyter Notebook:
When you open the site, you will see a pop-up window containing the following tabs —
EXAMPLES: Contain a number of Jupyter notebooks of various examples.
RECENT: Jupyter notebook you have recently worked with.
GOOGLE DRIVE: Jupyter notebook in your google drive.
GITHUB: You can add Jupyter notebook from your GitHub but you first need to connect Colab with GitHub.
UPLOAD: Upload from your local directory.
Otherwise, you can click New Python3 Notebook or New Python2 Notebook in the bottom right corner.
When you create a new notebook, it will create a Jupyter notebook with
Untitled0.ipynb and save it to its google drive in a folder named Colab Notebooks . Now, since this is essentially a Jupyter notebook, all Jupyter notebook commands will work here. However, you can refer to the details in
Use GPU and TPU:
Click on the "Runtime" dropdown menu. Select Change Runtime Type . Now select everything (GPU, CPU, None) you want from the Hardware Accelerator dropdown menu.
Check the GPU:
If a GPU is connected, it will output the following —
`/ device: GPU: 0`
Otherwise If the following will be displayed
If the GPU connected, it will output the following
Connected to TPU
Otherwise, it will output the following
Not connected to TPU
Install Python packages —
Use can use pip to install any package. For example:
Clone GitHub repo: b>
Use the git clone command. For example:
Select Choose File and upload the file you want. Please enable third party cookies if disabled.
You can then save it to an info frame.
| tr > |
Upload the file by connecting Google Drive:
To mount the drive in the "mntDrive" folder, do the following:
Then you will see the link, click the link, then allow access, copy the pop-up code and paste it into the "Enter authorization code:" field.
Now to see all the details on your google drive, you need to do the following:
You can also see the file hierarchy by clicking "& gt;" in the upper left corner under the control buttons (CODE, TEXT, CELL).
Let`s say you want to download" file_name.csv ". You can copy the file to your google drive (in the data folder you need to create a data folder in google drive) by doing the following:
"/ mntDrive / My Drive / data / renamed_file_name.csv"
The file will be saved in the data folder with the name renamed_file_name.csv. Now you can download directly from there, or, you can just open the file hierarchy and right-click will give the download option.
Download Jupyter Notebook:
Click the dropdown "File" in the upper left corner. Select "download .ipynb" or "download .py"
Share Jupyter Notebook:
You can share your notebook by adding someone else`s email address or creating a sharing link.
In the summer of 2008, after three decades of building software in corporate data centers, I walked away from corporate America to take a stab at building a technology company from the ground up based...
In Learn Python 3 the Hard Way PDF, you'll learn Python by working through 52 brilliantly crafted exercises. Read them. Enter your code exactly. (No copying and pasting!) Correct your mistakes. ...
If you can program, you are ready to grapple with Bayesian statistics. In this book, you'll learn how to solve statistical problems using Python code instead of math formulas, using discrete probabili...
Scientific progress has increasingly become reliant on large-scale data collection and analysis methodologies. The same is true for the advanced use of computing in business, government, and other are...