(self)
| 2163 | setattr(self, 'test_function', fn) |
| 2164 | |
| 2165 | def _make_predict_function(self): |
| 2166 | if not hasattr(self, 'predict_function'): |
| 2167 | self.predict_function = None |
| 2168 | if self.predict_function is None: |
| 2169 | inputs = self._feed_inputs |
| 2170 | # Gets network outputs. Does not update weights. |
| 2171 | # Does update the network states. |
| 2172 | kwargs = getattr(self, '_function_kwargs', {}) |
| 2173 | with K.name_scope(ModeKeys.PREDICT): |
| 2174 | self.predict_function = K.function( |
| 2175 | inputs, |
| 2176 | self.outputs, |
| 2177 | updates=self.state_updates, |
| 2178 | name='predict_function', |
| 2179 | **kwargs) |
| 2180 | |
| 2181 | def _make_execution_function(self, mode): |
| 2182 | if mode == ModeKeys.TRAIN: |
no test coverage detected