code: def load_logs(optimizer, logs):
      
      import json
  
      if isinstance(logs, str):
          logs = [logs]
  
      for log in logs:
          with open(log, "r") as j:
              while True:
                  try:
                      iteration = next(j)
                  except StopIteration:
                      break
  
                  iteration = json.loads(iteration)
                  try:
                      optimizer.register(
                          params=iteration["params"],
                          target=iteration["target"],
                      )
                  except KeyError:
                      pass
  
      return optimizer
docs: Load previous ...