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

Method get_value

methods/model.py:78–90  ·  view source on GitHub ↗
(self, inputs, uav_aoi, uav_snr, uav_compl, uav_tc_compl, temporal_hidden_state=None, mask=None,
                  spatial_hidden_state=None)

Source from the content-addressed store, hash-verified

76 return value, action_dia, action_log_probs_dia
77
78 def get_value(self, inputs, uav_aoi, uav_snr, uav_compl, uav_tc_compl, temporal_hidden_state=None, mask=None,
79 spatial_hidden_state=None):
80 if params.use_rnn:
81 if params.use_spatial_att:
82 obs_feature, _, _ = self.base(inputs, temporal_hidden_state, mask, spatial_hidden_state)
83 else:
84 obs_feature, _ = self.base(inputs, temporal_hidden_state, mask)
85 else:
86 obs_feature = self.base(inputs)
87
88 full_obs_feature = torch.cat([obs_feature, uav_aoi, uav_snr, uav_compl, uav_tc_compl], dim=1)
89 value = self.critic(full_obs_feature)
90 return value
91
92 def evaluate_actions(self, inputs, uav_aoi, uav_snr, uav_compl, uav_tc_compl, action, temporal_hidden_state=None,
93 mask=None, spatial_hidden_state=None):

Callers 1

trainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected