docstr: update value model self.model with Double DQN algorithm
          
docstr_tok: ["update","value","model","self.model","with","Double","DQN","algorithm"]
code: def learn(self, obs, action, reward, next_obs, terminal):
      """update value model self.model with Double DQN algorithm"""
      pred_value = self.model(obs).gather(1, action)
      # model for selection actions.
      greedy_action = self.model(next_obs).max(dim=1, keepdim=True)[1]
      with torch.no_grad():
          # target_model for evaluation.
          max_v = self.target_model(next_obs).gather(1, greedy_action)
          target = reward + (1 - terminal) * self.gamma * max_v
      self.optimizer.zero_grad()
      loss = self.mse_loss(pred_value, target)
      loss.backward()
      self.optimizer.step()
      return loss.item()
  
file_path: PARL/parl/algorithms/torch/ddqn.py
imports: import warnings
  import copy
  import torch
  import torch.optim
  import torch.nn.functional
  import parl
  from parl.utils.utils import check_model_method
  import numpy
label_desc: Use image node_id 3 for calling the DDQN obj's underlying member method code with example usage: obj.learn(obs, action, reward, next_obs, terminal) and returns: loss