1
Tensorflow에서 간단한 선형 모델을 생성하려고했습니다. 여기에 코드 ...텐서 흐름의 선형 모델
N = 400
features = 100
nSteps = 1000
data = (np.random.randn(N, features), np.random.randint(0, 2, N))
W = tf.placeholder(tf.float32, shape=(features,1), name='W')
b = tf.placeholder(tf.float32, shape=(features,1), name='b')
d = tf.constant(data[0], dtype=tf.float32)
result = tf.add(tf.matmul(d, W), b)
그것은 b
의 크기에 약간의 문제가있을 수 있음을 밝혀,하지만 지금까지 내가 말할 수있는 어떤 이유로, 그들은 모두 괜찮 니는 ...입니다
왜 이것이 오류를 던지고 있는지 잘 모르겠습니다. 누군가 제발 도와 줄 수 있니?
참고 :
result = tf.matmul(d, W)
이 괜찮습니다.
결과 모양을 확인했으며 b
과 동일합니다. 무엇이 문제인지는 잘 모릅니다.