[Google Colab] Developer guide for Google Colab

What is Google CoLab ?

Google Colaboratory is a promising machine learning research platform and free cloud service hosted by Google to encourage Machine Learning and Artificial Intelligence research. Now it supports free GPU!
The most important feature that distinguishes CoLab from other cloud services is totally free.

Hình ảnh có liên quan

Steps to start work on Google CoLab

  1. View the “Hello, Colaboratory”
    Visit this link: https://colab.research.google.com/
    Click Hello, Colaboratory or go to this link: https://colab.research.google.com/notebooks/welcome.ipynb
Hello, Colaboratory
import numpy as np

# Create the following rank 2 array with shape (3, 4)
# [[ 1 2 3 4]
# [ 5 6 7 8]
# [ 9 10 11 12]]
a = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]])

# Two ways of accessing the data in the middle row of the array.
# Mixing integer indexing with slices yields an array of lower rank,
# while using only slices yields an array of the same rank as the
# original array:
row_r1 = a[1, :] # Rank 1 view of the second row of a
row_r2 = a[1:2, :] # Rank 2 view of the second row of a
print(row_r1, row_r1.shape) # Prints "[5 6 7 8] (4,)"
print(row_r2, row_r2.shape) # Prints "[[5 6 7 8]] (1, 4)"

# We can make the same distinction when accessing columns of an array:
col_r1 = a[:, 1]
col_r2 = a[:, 1:2]
print(col_r1, col_r1.shape) # Prints "[ 2 6 10] (3,)"
print(col_r2, col_r2.shape) # Prints "[[ 2]
# [ 6]
# [10]] (3, 1)"