class_docstr: Benchmarks runtime and accuracy of crypten models
  
  Models are benchmarked on synthetically generated
  Gaussian clusters for binary classification. Resnet18 is
  benchmarks use image data.
  
  Args:
      n_samples (int): number of samples for Gaussian cluster model training
      n_features (int): number of features for the Gaussian clusters.
      epochs (int): number of training epochs
      lr_rate (float): learning rate.
class_docstr_tok: ["Benchmarks","runtime","and","accuracy","of","crypten","models","Models","are","benchmarked","on","synthetically","generated","Gaussian","clusters","for","binary","classification",".","Resnet18","is","benchmarks","use","image","data",".","Args",":","n_samples","(","int",")",":","number","of","samples","for","Gaussian","cluster","model","training","n_features","(","int",")",":","number","of","features","for","the","Gaussian","clusters",".","epochs","(","int",")",":","number","of","training","epochs","lr_rate","(","float",")",":","learning","rate","."]
docstr: Computes percent accuracy
  
  Args:
      output (torch.tensor): model output
      y (torch.tensor): true label
      threshold (float): classification threshold
  
  Returns (float): percent accuracy
docstr_tok: ["Computes","percent","accuracy","Args",":","output","(","torch.tensor",")",":","model","output","y","(","torch.tensor",")",":","true","label","threshold","(","float",")",":","classification","threshold","Returns","(","float",")",":","percent","accuracy"]
code: def calc_accuracy(output, y, threshold=0.5):
      """Computes percent accuracy
  
      Args:
          output (torch.tensor): model output
          y (torch.tensor): true label
          threshold (float): classification threshold
  
      Returns (float): percent accuracy
      """
      output, y = output.cpu(), y.cpu()
      predicted = (output > threshold).float()
      correct = (predicted == y).sum().float()
      accuracy = float((correct / y.shape[0]).cpu().numpy())
      return accuracy
  
imports: import argparse
  import functools
  import os
  import timeit
  from collections import namedtuple
  import crypten
  import crypten.communicator
  import numpy
  import pandas
  import torch
  from examples import multiprocess_launcher
label_desc: Use image node_id 9 for calling the ModelBenchmarks obj's underlying member method code with example usage: obj.calc_accuracy(output, y, threshold) and returns: accuracy