Package Contents

class flambe.model.LogisticRegression(input_size: int)[source]

Bases: flambe.nn.module.Module

Logistic regression model given an input vector v the forward calculation is sigmoid(Wv+b), where W is a weight vector and b a bias term. The result is then passed to a sigmoid function, which maps it as a real number in [0,1]. This is typically interpreted in classification settings as the probability of belonging to a given class.


Dimension (number of features) of the input vector.

forward(self, data: Tensor, target: Optional[Tensor] = None)

Forward pass that encodes data :param data: input data to encode :type data: Tensor :param target: target value, will be casted to a float tensor. :type target: Optional[Tensor]