text: − E 
  (cid:124) 
  F [q(s), o] = DKL[q(s)∥p(s)] 
  (cid:125) 
  (cid:124) 
  q(s)[ln p(o|s)] 
  (cid:123)(cid:122) 
  (cid:125) 
  Accuracy 
  
  (10) 
  
  (cid:123)(cid:122) 
  Complexity 
  
  Since the VFE can be calculated (Equation (5)), it can be used as a target for minimisation. 
  This allows us to choose the approximate posterior q(s) that is associated with the smallest 
  VFE; since the surprise does not depend on q(s), minimising the VFE this way must 
  necessarily reduce the divergence between the approximate and exact posterior. We now, 
  as is usually performed in variational inference, introduce a mean-field approximation [35] 
  so that the joint approximate posterior q(st) factorises across time steps t ∈ T and hidden 
  state factors f ∈ F: 
  
  T 
  ∏ 
  t=1 
  
  F 
  ∏ 
  f =1 
  
  The factorisation into hidden state factors allows us to calculate the VFE separately for each 
  factor f and sum them to obtain the total VFE. The factorisation in time allows us to calculate 
  the time-specific VFE as in Equation (6) using the predictive posterior ln p(st | st−1, ut−1) 
  from the last time step as the prior: 