Skip to content

Commit 5943a9d

Browse files
Update src/active_inference_forager/agents/dqn_fep_agent.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent d1be885 commit 5943a9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/active_inference_forager/agents/dqn_fep_agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ def update_belief(self, observation: np.ndarray) -> None:
163163

164164
def _update_belief_recursive(self, node: BeliefNode, observation: np.ndarray):
165165
# Ensure observation is a numpy array of floats
166-
observation = np.asarray(observation, dtype=np.float64)
166+
observation = np.asarray(observation)
167+
if observation.dtype != node.mean.dtype:
168+
observation = observation.astype(node.mean.dtype)
167169

168170
prediction_error = observation - node.mean
169171
node.precision += (

0 commit comments

Comments
 (0)