mednet.models.classify.logistic_regression¶
Logistic regression model for multi-class classification.
Classes
|
Logistic regression model for multi-class classification. |
- class mednet.models.classify.logistic_regression.LogisticRegression(loss_type=<class 'torch.nn.modules.loss.BCEWithLogitsLoss'>, loss_arguments={}, optimizer_type=<class 'torch.optim.adam.Adam'>, optimizer_arguments={'lr': 0.01}, num_classes=1, input_size=14)[source]¶
Bases:
ModelLogistic regression model for multi-class classification.
- Parameters:
The loss to be used for training and evaluation.
Warning
The loss should be set to always return batch averages (as opposed to the batch sum), as our logging system expects it so.
optimizer_type (
type[Optimizer]) – The type of optimizer to use for training.optimizer_arguments (
dict[str,Any]) – Arguments to the optimizer afterparams.num_classes (
int) – Number of outputs (classes) for this model.input_size (
int) – The number of inputs this classifer shall process.
- forward(x)[source]¶
Same as
torch.nn.Module.forward().- Parameters:
*args – Whatever you decide to pass into the forward method.
**kwargs – Keyword arguments are also possible.
- Returns:
Your model’s output