Hi,
I see that Facebook has a package for exactly that:

  
      github.com
  
  
    facebookresearch/SentEval/blob/master/senteval/tools/classifier.py 144
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#

"""
Pytorch Classifier class in the style of scikit-learn
Classifiers include Logistic Regression and MLP
"""

from __future__ import absolute_import, division, unicode_literals

import numpy as np
import copy
from senteval import utils

import torch
from torch import nn


  This file has been truncated. show original

  
  
    
    
  
  


and other useful stuff such as:

  
      
      GitHub
  
  
    

facebookresearch/SentEval 31

SentEval - A python tool for evaluating the quality of sentence embeddings.


  
  
    
    
  
  


Why isn’t this an integral part of PyTorch?
Thanks,