Hi,
I am very new to pytorch.
I am trying to use the below algo for my project.
How to add functions to save and load model ?
I want o save the model.
Then load the model and use the predict function.
Any sample code for me to learn and use ?

  
      github.com
  
  
    KDD-OpenSource/DeepADoTS/blob/master/src/algorithms/lstm_ad.py
import numpy as np
import pandas as pd
import torch
from scipy.stats import multivariate_normal
from torch.autograd import Variable
from tqdm import trange

from .algorithm_utils import Algorithm, PyTorchUtils


class LSTMAD(Algorithm, PyTorchUtils):
    """ LSTM-AD implementation using PyTorch.
    The interface of the class is sklearn-like.
    """

    def __init__(self, len_in=1, len_out=10, num_epochs=100, lr=1e-3, batch_size=1,
                 seed: int=None, gpu: int=None, details=True):
        Algorithm.__init__(self, __name__, 'LSTM-AD', seed, details=details)
        PyTorchUtils.__init__(self, seed, gpu)
        self.num_epochs = num_epochs


  This file has been truncated. show original

  
  
    
    
  
  


Please help.
Thank you