1
컨볼 루션 모델을 만들 때 TensorBoard에서 매우 이상한 결과 그래프가 나타납니다. 보시다시피 두 번째 컨볼 루션 레이어는 풀링 레이어를 입력으로 가져올뿐만 아니라 다른 길쌈 레이어를 가져옵니다. 필자의 의견으로는 웹 연구에 따르면 레이어 당 하나의 입력과 하나의 출력을 가진 직선적 인 수직 그래프 여야합니다 (아주 처음과 마지막 것을 제외하고).길쌈 네트워크의 이상한 그래프
잘못된 것이 있습니까? 아니면이 두 번째 입력이 어디에서 왔습니까?
, 당신에게 토비아스를 대단히 감사합니다
중고 모델 기능 :
def model_fn(features, labels, mode, params):
is_training = (mode == tf.estimator.ModeKeys.TRAIN)
reshaped_features = tf.reshape(features, (-1, features.shape[1], 1))
# Yes, I have only 1d input to my conv network
conv1 = tf.layers.conv1d(reshaped_features, filters=10, kernel_size=5)
pool1 = tf.layers.max_pooling1d(conv1, pool_size=3, strides=1)
conv2 = tf.layers.conv1d(pool1, filters=10, kernel_size=5)
conv_2_flat = tf.contrib.layers.flatten(conv2)
logits = fully_connected(conv_2_flat, 2)
if mode == tf.estimator.ModeKeys.PREDICT:
return tf.estimator.EstimatorSpec(
mode=mode,
predictions={'logits': logits})
loss = tf.losses.sparse_softmax_cross_entropy(labels=labels, logits=logits)
eval_metric_ops = {
'accuracy': tf.metrics.mean(tf.nn.in_top_k(predictions=logits, targets=labels, k=1)),
}
optimizer = tf.train.AdamOptimizer(params['learning_rate'])
training_op = optimizer.minimize(loss)
return tf.estimator.EstimatorSpec(
mode=mode,
loss=loss,
train_op=training_op,
eval_metric_ops=eval_metric_ops)
결과 그래프 :
와우,이 문제가 실제로 해결되었습니다! 빠른 답변 주셔서 감사합니다! – user3429596