# Explanation of DNNClassifier in TensorFlow [closed]

I used tf.estimator.DNNClassifier, a high-level API in tensorflow, to perform a binary classification. It works very well for my purpose, but I am a principiante in Machine Learning and I would like to know better how it works.

Considering this example, what kind of neaural network is used? How is it structured? What activation do you use? And so on.

I apologize for the trivial question, but I'm a beginner and I would want a simple general guide.

## closed as off-topic by Tim♦Aug 3 '18 at 4:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – Tim
If this question can be reworded to fit the rules in the help center, please edit the question.

General tip: if you set model_dir parameter of your estimator, it will log model summary into that directory while training and you can then run tensorboard tool to visualize your particular graph.

Regarding tf.estimator.DNNClassifier, its graph is a just collection of dense layers. The example from the documentation:

estimator = DNNClassifier(
feature_columns=[categorical_feature_a_emb, categorical_feature_b_emb],
hidden_units=[1024, 512, 256])


... defines 3 hidden dense layers with 1024 units, 512 units and 256 units. In addition to that, there is an input layer, which size is determined by feature_columns parameter, and the head (can be binary or multiclass depending on n_classes parameter). Hidden layers can also be followed by the dropout layer, if you specify dropout. And that's it.

• Hi and thanks for your explanation. Just one thing, why is this DNNClassifier working on images? Actually this model performs really good on MNIST data. However, I don't get it why a model like this and not CNN is working pretty well on image data. Would you explain it please? – hexpheus Aug 12 '18 at 6:18
• CNN will definitely hit higher accuracy on images. But for MNIST there is probably a strong correlation between the number of black pixels and the label. This allows a pretty simple NN to show fairly good accuracy, but not as good as modern CNNs do. – Maxim Aug 12 '18 at 7:51