original_docstring: r"""Draw 2 plots: One shows the shape of the current solution. The other shows the history training loss and validation loss.
  
          :param nets: The neural networks that approximates the ODE (system).
          :type nets: list[`torch.nn.Module`]
          :param conditions: The initial/boundary conditions of the ODE (system).
          :type conditions: list[`neurodiffeq.ode.IVP` or `neurodiffeq.ode.DirichletBVP` or `neurodiffeq.ode.NoCondition`]
          :param loss_history: The history of training loss and validation loss. The 'train' entry is a list of training loss and 'valid' entry is a list of validation loss.
          :type loss_history: dict['train': list[float], 'valid': list[float]]
  
          .. note::
              `check` is meant to be called by the function `solve` and `solve_system`.
          
docstring: r"""Draw 2 plots: One shows the shape of the current solution. The other shows the history training loss and validation loss.
docstring_tokens: r " " " Draw 2 plots : One shows the shape of the current solution . The other shows the history training loss and validation loss .
code: def check(self, single_net, nets, conditions, loss_history):
          r"""Draw 2 plots: One shows the shape of the current solution. The other shows the history training loss and validation loss.
  
          :param nets: The neural networks that approximates the ODE (system).
          :type nets: list[`torch.nn.Module`]
          :param conditions: The initial/boundary conditions of the ODE (system).
          :type conditions: list[`neurodiffeq.ode.IVP` or `neurodiffeq.ode.DirichletBVP` or `neurodiffeq.ode.NoCondition`]
          :param loss_history: The history of training loss and validation loss. The 'train' entry is a list of training loss and 'valid' entry is a list of validation loss.
          :type loss_history: dict['train': list[float], 'valid': list[float]]
  
          .. note::
              `check` is meant to be called by the function `solve` and `solve_system`.
          """
          us = _trial_solution(single_net, nets, self.ts_ann, conditions)
          us = [u.detach().cpu().numpy() for u in us]
  
          self.ax1.clear()
          for i, u in enumerate(us):
              self.ax1.plot(self.ts_plt, u, label=f'variable {i}')
          self.ax1.legend()
          self.ax1.set_title('solutions')
  
          self.ax2.clear()
          self.ax2.plot(loss_history['train'], label='training loss')
          self.ax2.plot(loss_history['valid'], label='validation loss')
          self.ax2.set_title('loss during training')
          self.ax2.set_ylabel('loss')
          self.ax2.set_xlabel('epochs')
          self.ax2.set_yscale('log')
          self.ax2.legend()
  
          self.fig.canvas.draw()
          if not self.using_non_gui_backend:
              plt.pause(0.05)
code_tokens: def check ( self , single_net , nets , conditions , loss_history ) : us = _trial_solution ( single_net , nets , self . ts_ann , conditions ) us = [ u . detach ( ) . cpu ( ) . numpy ( ) for u in us ] self . ax1 . clear ( ) for i , u in enumerate ( us ) : self . ax1 . plot ( self . ts_plt , u , label = f'variable {i}' ) self . ax1 . legend ( ) self . ax1 . set_title ( 'solutions' ) self . ax2 . clear ( ) self . ax2 . plot ( loss_history [ 'train' ] , label = 'training loss' ) self . ax2 . plot ( loss_history [ 'valid' ] , label = 'validation loss' ) self . ax2 . set_title ( 'loss during training' ) self . ax2 . set_ylabel ( 'loss' ) self . ax2 . set_xlabel ( 'epochs' ) self . ax2 . set_yscale ( 'log' ) self . ax2 . legend ( ) self . fig . canvas . draw ( ) if not self . using_non_gui_backend : plt . pause ( 0.05 )
short_docstring: r"""Draw 2 plots: One shows the shape of the current solution.
short_docstring_tokens: r " " " Draw 2 plots : One shows the shape of the current solution .
comment: r"""Draw 2 plots: One shows the shape of the current solution. The other shows the history training loss and validation loss.
  
          :param nets: The neural networks that approximates the ODE (system).
          :type nets: list[`torch.nn.Module`]
          :param conditions: The initial/boundary conditions of the ODE (system).
          :type conditions: list[`neurodiffeq.ode.IVP` or `neurodiffeq.ode.DirichletBVP` or `neurodiffeq.ode.NoCondition`]
          :param loss_history: The history of training loss and validation loss. The 'train' entry is a list of training loss and 'valid' entry is a list of validation loss.
          :type loss_history: dict['train': list[float], 'valid': list[float]]
  
          .. note::
              `check` is meant to be called by the function `solve` and `solve_system`.
          """