class_docstr: Tests PyTorch and Tensorflow model imports
docstr: Tests from_pytorch CrypTen training for regression models
docstr_tok: ["Tests","from_pytorch","CrypTen","training","for","regression","models"]
code: def test_from_pytorch_training_regression(self):
      """Tests from_pytorch CrypTen training for regression models"""
      import torch.nn as nn
      import torch.nn.functional as F
  
      class FeedForward(nn.Module):
          def __init__(self):
              super(FeedForward, self).__init__()
              self.fc1 = nn.Linear(3, 10)
              self.fc2 = nn.Linear(10, 1)
  
          def forward(self, x):
              out = self.fc1(x)
              out = F.relu(out)
              out = self.fc2(out)
              return out
  
      model_plaintext = FeedForward()
      batch_size = 5
  
      x_orig = get_random_test_tensor(
          size=(batch_size, 3), is_float=True
      )
      dummy_input = torch.empty((1, 3))
      # y is a linear combo of features 1 and 3
      y_orig = 2 * x_orig[:, 0] + 3 * x_orig[:, 2]
  
      x_train = crypten.cryptensor(x_orig, requires_grad=True)
      y_train = crypten.cryptensor(y_orig.unsqueeze(-1))
  
      # create encrypted model
      model = crypten.nn.from_pytorch(model_plaintext, dummy_input)
      model.train()
      model.encrypt()
  
      self._check_training(model, x_train, y_train, "MSELoss")
      self._check_model_export(model, x_train)
  
imports: import collections
  import io
  import logging
  import os
  import unittest
  import crypten
  import torch
  from crypten.common.tensor_types import is_float_tensor
  from crypten.config import cfg
  from crypten.nn import onnx_converter
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase, onehot
label_desc: Use image node_id 6 for calling the TestOnnxConverter obj's underlying member method code with example usage: obj.test_from_pytorch_training_regression() and returns: out