Linear Classifier
-
In [1]: import numpy as npimport tensorflow as tfimport timenp.random.seed(101) 2022-10-12 17:13:46.461742: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.build you..
Linear Classifier 02In [1]: import numpy as npimport tensorflow as tfimport timenp.random.seed(101) 2022-10-12 17:13:46.461742: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.build you..
2024.09.10 -
In [1]: import numpy as npnp.random.seed(101) build your own data¶x_train: [12, 4] y_train: [12, ] x_test: [4, 4] y_test: [4, ][1, 0, 0, 0] --> 0 [0, 1, 0, 0] --> 0 [0, 0, 1, 0] --> 1 [0, 0, 0, 1] --> 1In [2]: x_train = np.zeros(shape=[12, 4], dtype=np.float32)y_train = np.random.randint(0, 4, [12, ])print(x_train)print(y_train) [[0. 0. 0. 0.] [0. 0. 0. 0.] [0. 0. 0. 0.] ..
Linear Classifier 01In [1]: import numpy as npnp.random.seed(101) build your own data¶x_train: [12, 4] y_train: [12, ] x_test: [4, 4] y_test: [4, ][1, 0, 0, 0] --> 0 [0, 1, 0, 0] --> 0 [0, 0, 1, 0] --> 1 [0, 0, 0, 1] --> 1In [2]: x_train = np.zeros(shape=[12, 4], dtype=np.float32)y_train = np.random.randint(0, 4, [12, ])print(x_train)print(y_train) [[0. 0. 0. 0.] [0. 0. 0. 0.] [0. 0. 0. 0.] ..
2024.09.10