I have created a neural network using tensorflow's estimator API:

classifier = tf.estimator.DNNRegressor(feature_columns=feature_columns,hidden_units=[10,20,10],n_classes = 3)
classifier.train(input_fn=lambda: input_fn(X_train,y_train),steps = 1000).   

I would like to create an ensemble of these neural networks, since there is some randomness in the output of an individual network, even if the RMSE is acceptable.

So far the only way I have found of doing so is to use a loop which trains the estimator and then generates predictions over a number of iterations, storing the output in an array and then averaging the values to get my ensemble prediction.

But there must be a better way to do than using tf.estimator.




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.