浏览器访问ip(oled上显示的ip地址):8888,如192.168.10107:8888,Password:jetbot。
双击Notebool下的Python 3,然后编辑代码:
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import math
#We'll generate this many sample datapoints
SAMPLES = 1000
#Set a "seed" value, so we get the same random numbers each time we run this
#notebook. Any number can be used here.
SEED = 1337
np.random.seed(SEED)
tf.random.set_random_seed(SEED)
#Generate a uniformly distributed set of random numbers in the range from
#0 to 2n, which covers a complete sine wave oscillation
x_values = np.random.uniform(low=0, high=2*math.pi, size=SAMPLES)
#Shuffle the values to guarantee they're not in orders
np.random.shuffle(x_values)
#Calculate the corresponding sine values
y_values = np.sin(x_values)
#plot our data. The 'b.' argument tells the library to print blue dots.
plt.plot(x_values, y_values, 'b.')
plt.show()
然后运行,显示如下:
注意:
jetbot没有matplotlib.pyplot库,需要使用terminal安装。
双击Other下的Terminal,然后执行如下命令安装matplotlib.pyplot:
#apt-get
#apt-get install python3-matplotlib