1
동적 rnn 견적서를 교육하려고하지만 회귀 데이터를 사용하여 올바른 데이터 모양을 식별 할 수 없습니다. tensorflow DynamicRnnEstimator - 접두사 또는 접미사 없음
import random
import numpy as np
import tensorflow as tf
from tensorflow.contrib.learn import DynamicRnnEstimator
from tensorflow.contrib.learn.python.learn.estimators.constants import (
ProblemType,
)
from tensorflow.contrib.learn.python.learn.estimators.rnn_common import (
PredictionType,
)
from tensorflow.contrib.layers import real_valued_column
X = np.random.uniform(size=(1000, 10))
M = X.shape[0]
N = X.shape[1]
y = np.random.uniform(size=1000)
seq_feat_cols = [real_valued_column(column_name='X', dimension=N)]
rnn = DynamicRnnEstimator(ProblemType.LINEAR_REGRESSION,
PredictionType.SINGLE_VALUE,
sequence_feature_columns=seq_feat_cols)
def get_batch():
period_steps = 20
start = random.randint(0, (M - 1) - period_steps - 1)
end = start + period_steps
x_tf = tf.expand_dims(X[start:end], axis=0)
return {'X': x_tf}, tf.constant(y[start:end])
rnn.fit(input_fn=get_batch, steps=10)
이
가 산출된다 : 나는 아무 소용이 내 ndarray의 양쪽에있는 차원을 확장하려고했습니다ValueError: Provided a prefix or suffix of None: 1 and None
; 어떤 제안이라도 대단히 감사하겠습니다!