hanbt / learn_dl

Deep learning algorithms source code for beginners
Apache License 2.0
1.2k stars 988 forks source link

画图怎么画呢 老提示matplotlib does not support generators as input #50

Open potatoper opened 5 years ago

potatoper commented 5 years ago

def plot(linear_unit): import matplotlib.pyplot as plt input_vecs, labels = get_training_dataset() fig = plt.figure() ax = fig.add_subplot(111) ax.scatter(map(lambda x: x[0], input_vecs), labels) weights = linear_unit.weights bias = linear_unit.bias x = range(0,12,1) y = map(lambda x:weights[0] * x + bias, x) ax.plot(x, y) plt.show()