Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added forward_features inside Estimator class of Adanet. #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions adanet/core/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ def __init__(self,
enable_subnetwork_summaries=True,
global_step_combiner_fn=tf.math.reduce_mean,
max_iterations=None,
forward_feature_keys=None,
sparse_default_values=None,
**kwargs):
if subnetwork_generator is None:
raise ValueError("subnetwork_generator can't be None.")
Expand Down Expand Up @@ -596,6 +598,18 @@ def _latest_checkpoint_global_step(self):
return tf.train.load_variable(latest_checkpoint,
tf_compat.v1.GraphKeys.GLOBAL_STEP)

def forward_features(self,
estimator,
forward_feature_keys=None,
sparse_default_values=None):
if forward_feeature_keys is not None:
result = tf.contrib.estimator.forward_features(super(Estimator, self),
forward_feature_keys=forward_feature_keys,
sparse_default_values=sparse_default_values)
return result
else:
raise ValueError("No key/(s) provided to forward features.")

def train(self,
input_fn,
hooks=None,
Expand Down