neuraltrain.models.dummy_predictor.DummyPredictorModel¶
- class neuraltrain.models.dummy_predictor.DummyPredictorModel(out: Tensor | None = None, probs: Tensor | None = None, random_state: int | None = None)[source][source]¶
Evaluation-only module that implements the dummy prediction strategies.
Constructed by
DummyPredictor.build(); not intended to be built directly by users. Depending on the mode chosen at build time, either returns a constant tensor tiled across the batch dimension (out) or samples fresh Bernoulli draws per call using a cachedtorch.Generator(probs+random_state).- forward(X: Tensor) Tensor[source][source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.