DAPPER (Document Analysis, Processing, and Pattern Extraction Repository)
Statistical Learning Final Project for Document Classification
 
Loading...
Searching...
No Matches
hybrid.HybridClassifier Class Reference
Collaboration diagram for hybrid.HybridClassifier:
Collaboration graph

Public Member Functions

 __init__ (self, int num_classes, int vocab_size, int embedding_dim=100, int word_hidden_dim=50, int sent_hidden_dim=50, str lsnet_model_size='s', float dropout=0.5, float learning_rate=0.0005, float weight_decay=0.03, Optional[str] device=None, int num_epochs=50, bool use_resnet=True, str resnet_model_name="resnet50", bool resnet_pretrained=True)
 Constructor for HybridClassifier.
 

Public Attributes

 num_classes
 
 vocab_size
 
 embedding_dim
 
 word_hidden_dim
 
 sent_hidden_dim
 
 lsnet_model_size
 
 dropout
 
 learning_rate
 
 weight_decay
 
 num_epochs
 
 use_resnet
 
 resnet_model_name
 
 resnet_pretrained
 
 device
 
 model
 
 optimizer
 
 criterion
 
 scheduler
 

Detailed Description

Classifier that uses the HybridModel for document classification.
This classifier combines the strengths of LSNet or ResNet for image processing
and EAML for OCR text processing.

Constructor & Destructor Documentation

◆ __init__()

hybrid.HybridClassifier.__init__ (   self,
int  num_classes,
int  vocab_size,
int   embedding_dim = 100,
int   word_hidden_dim = 50,
int   sent_hidden_dim = 50,
str   lsnet_model_size = 's',
float   dropout = 0.5,
float   learning_rate = 0.0005,
float   weight_decay = 0.03,
Optional[str]   device = None,
int   num_epochs = 50,
bool   use_resnet = True,
str   resnet_model_name = "resnet50",
bool   resnet_pretrained = True 
)

Constructor for HybridClassifier.

Parameters
num_classesNumber of document classes
vocab_sizeSize of the vocabulary for text embedding
embedding_dimDimension of the word embeddings
word_hidden_dimDimension of the word-level GRU hidden state
sent_hidden_dimDimension of the sentence-level GRU hidden state
lsnet_model_sizeLSNet model size ('t', 's', or 'b')
dropoutDropout rate for regularization
learning_rateLearning rate for the optimizer
weight_decayWeight decay for the optimizer
deviceDevice to use for training (CPU or GPU)
num_epochsNumber of training epochs
use_resnetWhether to use ResNet instead of LSNet
resnet_model_nameName of the ResNet model to use
resnet_pretrainedWhether to use pre-trained ResNet weights

Member Data Documentation

◆ criterion

hybrid.HybridClassifier.criterion

◆ device

hybrid.HybridClassifier.device

◆ dropout

hybrid.HybridClassifier.dropout

◆ embedding_dim

hybrid.HybridClassifier.embedding_dim

◆ learning_rate

hybrid.HybridClassifier.learning_rate

◆ lsnet_model_size

hybrid.HybridClassifier.lsnet_model_size

◆ model

hybrid.HybridClassifier.model

◆ num_classes

hybrid.HybridClassifier.num_classes

◆ num_epochs

hybrid.HybridClassifier.num_epochs

◆ optimizer

hybrid.HybridClassifier.optimizer

◆ resnet_model_name

hybrid.HybridClassifier.resnet_model_name

◆ resnet_pretrained

hybrid.HybridClassifier.resnet_pretrained

◆ scheduler

hybrid.HybridClassifier.scheduler

◆ sent_hidden_dim

hybrid.HybridClassifier.sent_hidden_dim

◆ use_resnet

hybrid.HybridClassifier.use_resnet

◆ vocab_size

hybrid.HybridClassifier.vocab_size

◆ weight_decay

hybrid.HybridClassifier.weight_decay

◆ word_hidden_dim

hybrid.HybridClassifier.word_hidden_dim

The documentation for this class was generated from the following file: