Using TensorFlow Feature Columns in your Custom Estimator Model
The TensorFlow canned estimators got promoted to core in version 1.3 to make training and evaluation of machine learning models very easy. This API allows you to describe your input data (categorical, numeric, embedding etc) through the use of feature columns. The estimator API also allows you to write a custom model for your unique job, and the feature columns capabilities can be utilised here as well to simplify or enhance things. In a custom estimator, you are required to write a model_fn and it’s here you utilise your features from your input_fn with your model architecture. To showcase using the tf.feature_column API, lets compare an embedding column with and without this module. Without the feature column API, a typical embedding of your features can be setup as so: ...