MCPcopy Create free account
hub / github.com/BIT-MCS/DRL-eFresh / forward

Method forward

methods/model.py:286–302  ·  view source on GitHub ↗
(self, inputs, temporal_hidden_state=None, masks=None, spatial_hidden_state=None)

Source from the content-addressed store, hash-verified

284 return x, t_h, s_h
285
286 def forward(self, inputs, temporal_hidden_state=None, masks=None, spatial_hidden_state=None):
287 if not params.use_rnn:
288 x = self.feature(inputs)
289 x = self.conv_to_flat(x)
290 return x
291
292 if params.use_rnn and params.use_spatial_att is False: # TODO
293 x = self.feature(inputs)
294 x = self.conv_to_flat(x)
295 x, temporal_hidden_state = self._forward_gru(x, temporal_hidden_state, masks)
296 return x, temporal_hidden_state
297
298 if params.use_rnn and params.use_spatial_att:
299 x = inputs
300 x, temporal_hidden_state, spatial_hidden_state, = self._forward_spatial_gru(x, temporal_hidden_state, masks,
301 spatial_hidden_state)
302 return x, temporal_hidden_state, spatial_hidden_state
303
304
305class Shared_grad_buffers():

Callers

nothing calls this directly

Calls 2

_forward_gruMethod · 0.95
_forward_spatial_gruMethod · 0.95

Tested by

no test coverage detected