code: def _build_network(self):
      # sampling a random beta distribution
      # random distribution helps with diversity in trees and feature splits
      alpha = random.uniform(0.5, 10.0)
      beta = random.uniform(0.5, 10.0)
      # with torch.no_grad():
      feature_mask = (
          torch.distributions.Beta(
              torch.tensor([alpha]), torch.tensor([beta])
          )
          .sample((self.n_features,))
          .squeeze(-1)
      )
      self.feature_mask = nn.Parameter(feature_mask, requires_grad=True)
      if self.feature_mask_function.__name__ == "t_softmax":
          t = RSoftmax.calculate_t(
              self.feature_mask, r=torch.tensor([self.feature_sparsity])
          )
          self.t = nn.Parameter(
              t, requires_grad=self.learnable_sparsity
          )
      W = torch.linspace(
          1.0,
          self._num_cutpoints + 1.0,
          self._num_cutpoints + 1,
          requires_grad=False,
      ).reshape(1, 1, -1)
      self.register_buffer("W", W)
  
      cutpoints = torch.rand([self.n_features, self._num_cutpoints])
      # Append zeros to the beginning of each row
      cutpoints = torch.cat(
          [
              torch.zeros(
                  [self.n_features, 1], device=cutpoints.device
              ),
              cutpoints,
          ],
          1,
      )
      self.cut_points = nn.Parameter(cutpoints, requires_grad=True)
      self.leaf_responses = nn.Parameter(
          torch.rand(self.n_features, self._num_leaf),
          requires_grad=True,
      )
  
imports: import random
  from typing import Callable
  from warnings import warn
  import numpy
  import torch
  import torch.nn
  from pytorch_tabular.utils import check_numpy
  from ..layers import ModuleWithInit
  from .activations import RSoftmax, entmax15, sparsemax, sparsemoid
label_desc: Use image node_id 2 for calling the NeuralDecisionStump obj's underlying member method code with example usage: obj._build_network() without return types