Provide a public property to access model_fn of an Estimator. An example usage...
Provide a public property to access model_fn of an Estimator. An example usage of it for extending model_fn is in tf.contrib.estimator.add_metrics function. Design decisions: * `params` is bound to the returned function: model_fn is made public to help framework developers to extend/compose estimators. We assumed that framework developer does not know much information about how one estimator/model_fn is constructed. We think `params` is part of model_fn construction. If a framework combines estimators, each estimator may be created with different params. Combining those params into single one may create conflicts. * model_fn property have a fixed signature instead of optional arguments. We made model_fn arguments as optional to simplify model_fn implementations. In this case users are not model_fn developers but model_fn users. If we kept the arguments optional, then framework developers should handle that optional logic for every model_fn usage. Also model_fn is called by Estimator. Estimator have all those arguments. So there is no need to make them optional. PiperOrigin-RevId: 167914400
Loading
Please sign in to comment