Get the data set used in Chapter 7.
num_inputs = 2
num_examples = 1000
true_w = [2, -3.4]
true_b = 4.2
features = nd.random.normal(scale=1, shape=(num_examples, num_inputs))
labels = true_w[0] * features[:, 0] + true_w[1] * features[:, 1] + true_b
labels += nd.random.normal(scale=0.01, shape=labels.shape)
return num_inputs, num_examples, true_w, true_b, features, labels
def get_fashion_mnist_labels(labels):
Get text label for fashion mnist.
After Change
def get_data_ch7():
Get the data set used in Chapter 7.
data = np.genfromtxt("../data/airfoil_self_noise.dat", delimiter="\t")
data = (data - data.mean(axis=0)) / data.std(axis=0)
return nd.array(data[:, :-2]), nd.array(data[:,-1])
def get_fashion_mnist_labels(labels):
Get text label for fashion mnist.