def reset_parameters(self):
        """Resets this layer's parameters to their initial values."""
        for h in range(self.config.num_heads):
            for i, gate in enumerate(["i", "f", "z", "o"]):
                if self.config.recurrent_weight_init == "zeros":
                    self.recurrent_kernel[h, :, i, :] = nn.init.zeros_(
                        self.recurrent_kernel[h, :, i, :]
                    )
                elif self.config.recurrent_weight_init == "standard":
                    self.recurrent_kernel[h, :, i, :] = nn.init.uniform_(
                        self.recurrent_kernel[h, :, i, :],
                        -1.0 / sqrt(self.config.hidden_size),
                        1.0 / sqrt(self.config.hidden_size),
                    )
        for h in range(self.config.num_heads):
            for i, gate in enumerate(["i", "f", "z", "o"]):
                if self.config.bias_init == "powerlaw_blockdependent":
                    if gate == "f":
                        kwargs = (
                            dict(
                                right_x=5.0,
                                range_x_neg_dir=12.0,
                                spread_lower=0.3,
                                spread_upper=3.0,
                            ),
                        )
                        ratio_0_to_1 = (
                            self.config._block_idx / (self.config._num_blocks - 1)
                            if self.config._num_blocks > 1
                            else 0.0
                        )
                        init_values = -(
                            -5.0
                            + 12.0
                            * (
                                torch.arange(self.config.head_dim)
                                / (self.config.head_dim - 1)
                            )
                            ** (0.3 + 1.3 * ratio_0_to_1)
                        )
                        with torch.no_grad():
                            self.bias[h, i, :] = init_values
                    else:
                        self.bias[h, i] = nn.init.zeros_(self.bias[h, i])
                elif self.config.bias_init == "small_init":
                    if gate == "f":
                        self.bias[h, i] = bias_linspace_init_(
                            self.bias[h, i], start=3.0, end=6.0
                        )
                    else:
                        self.bias[h, i] = nn.init.zeros_(self.bias[h, i])
                elif self.config.bias_init == "zeros":
                    self.bias[h, i] = nn.init.zeros_(self.bias[h, i])
                elif self.config.bias_init == "standard":
                    self.bias[h, i] = nn.init.uniform_(
                        self.bias[h, i],
                        -1 / sqrt(self.config.hidden_size),
                        1 / sqrt(self.config.hidden_size),
                    )
Resets this layer's parameters to their initial values.
xlstm/blocks/slstm/cell.py