quantlab.model.predefined.master.Gate#
- class quantlab.model.predefined.master.Gate(d_input, d_output, beta)[source]#
Bases:
ModuleF · softmax(Linear(market) / beta): weights for F features that sum to F.Examples
>>> weights = Gate(2, 5, beta=5.0)(torch.randn(3, 2)) >>> weights.shape, [round(w, 4) for w in weights.sum(dim=-1).tolist()] (torch.Size([3, 5]), [5.0, 5.0, 5.0])