class_docstr: A policy that outputs actions based on observation and latent context.
  
  In PEARL, policies are conditioned on current state and a latent context
  (adaptation data) variable Z. This inference network estimates the
  posterior probability of z given past transitions. It uses context
  information stored in the encoder to infer the probabilistic value of z and
  samples from a policy conditioned on z.
  
  Args:
      latent_dim (int): Latent context variable dimension.
      context_encoder (garage.torch.embeddings.ContextEncoder): Recurrent or
          permutation-invariant context encoder.
      policy (garage.torch.policies.Policy): Policy used to train the
          network.
      use_information_bottleneck (bool): True if latent context is not
          deterministic; false otherwise.
      use_next_obs (bool): True if next observation is used in context
          for distinguishing tasks; false otherwise.
class_docstr_tok: ["A","policy","that","outputs","actions","based","on","observation","and","latent","context",".","In","PEARL",",","policies","are","conditioned","on","current","state","and","a","latent","context","(","adaptation","data",")","variable","Z",".","This","inference","network","estimates","the","posterior","probability","of","z","given","past","transitions",".","It","uses","context","information","stored","in","the","encoder","to","infer","the","probabilistic","value","of","z","and","samples","from","a","policy","conditioned","on","z.","Args",":","latent_dim","(","int",")",":","Latent","context","variable","dimension",".","context_encoder","(","garage.torch.embeddings.ContextEncoder",")",":","Recurrent","or","permutation-invariant","context","encoder",".","policy","(","garage.torch.policies.Policy",")",":","Policy","used","to","train","the","network",".","use_information_bottleneck","(","bool",")",":","True","if","latent","context","is","not","deterministic",";","false","otherwise",".","use_next_obs","(","bool",")",":","True","if","next","observation","is","used","in","context","for","distinguishing","tasks",";","false","otherwise","."]
docstr: Return context_encoder and policy.
  
  Returns:
      list: Encoder and policy networks.
docstr_tok: ["Return","context_encoder","and","policy",".","Returns",":","list",":","Encoder","and","policy","networks","."]
code: def networks(self):
      """Return context_encoder and policy.
  
      Returns:
          list: Encoder and policy networks.
  
      """
      return [self._context_encoder, self._policy]
  
file_path: garage/src/garage/torch/policies/context_conditioned_policy.py
imports: import numpy
  import torch
  from torch import nn
  import torch.nn.functional
  from garage.torch import global_device, product_of_gaussians
label_desc: Use image node_id 9 for calling the ContextConditionedPolicy obj's underlying member method code with example usage: obj.networks() and returns: list