class_docstr: Base class for associative algorithms which have 2 layers and first
  one is has step function as activation.
  
  Parameters
  ----------
  {BaseAssociative.n_inputs}
  
  {BaseAssociative.n_outputs}
  
  n_unconditioned : int
      Number of unconditioned units in neural networks. All these
      units wouldn't update during the training procedure.
      Unconditioned should be the first feature in the dataset.
  
  weight : array-like
      Neural network weights.
      Value defined manually should have shape ``(n_inputs, n_outputs)``.
      Defaults to ``None`` which means that all unconditional
      weights will be equal to ``1``. Other weights equal to ``0``.
  
  bias : array-like, Initializer
      Neural network bias units.
      Defaults to :class:`Constant(-0.5) <neupy.init.Constant>`.
  
  {BaseNetwork.Parameters}
  
  Methods
  -------
  {BaseAssociative.Methods}
class_docstr_tok: ["Base","class","for","associative","algorithms","which","have","2","layers","and","first","one","is","has","step","function","as","activation",".","Parameters","--","--","--","--","--","{","BaseAssociative.n_inputs","}","{","BaseAssociative.n_outputs","}","n_unconditioned",":","int","Number","of","unconditioned","units","in","neural","networks",".","All","these","units","would","n't","update","during","the","training","procedure",".","Unconditioned","should","be","the","first","feature","in","the","dataset",".","weight",":","array-like","Neural","network","weights",".","Value","defined","manually","should","have","shape","``","(","n_inputs",",","n_outputs",")","``",".","Defaults","to","``","None","``","which","means","that","all","unconditional","weights","will","be","equal","to","``","1","``",".","Other","weights","equal","to","``","0","``",".","bias",":","array-like",",","Initializer","Neural","network","bias","units",".","Defaults","to",":","class",":","`","Constant","(","-0.5",")","<","neupy.init.Constant",">","`",".","{","BaseNetwork.Parameters","}","Methods","--","--","--","-","{","BaseAssociative.Methods","}"]
code: def init_weights(self):
      if self.n_inputs <= self.n_unconditioned:
          raise ValueError(
              "Number of unconditioned features should be less than total "
              "number of features. `n_inputs`={} and `n_unconditioned`={}"
              "".format(self.n_inputs, self.n_unconditioned)
          )
  
      valid_weight_shape = (self.n_inputs, self.n_outputs)
      valid_bias_shape = (self.n_outputs,)
  
      if self.weight is None:
          self.weight = np.zeros(valid_weight_shape)
          self.weight[: self.n_unconditioned, :] = 1
  
      if isinstance(self.bias, init.Initializer):
          self.bias = self.bias.sample(
              valid_bias_shape, return_array=True
          )
  
      super(BaseStepAssociative, self).init_weights()
  
      if self.bias.shape != valid_bias_shape:
          raise ValueError(
              "Bias vector has invalid shape. Got {}, expected {}"
              "".format(self.bias.shape, valid_bias_shape)
          )
  
      self.bias = self.bias.astype(float)
  
file_path: neupy/neupy/algorithms/associative/base.py
imports: import numpy
  from neupy import init
  from neupy.utils import format_data
  from neupy.core.properties import IntProperty, ParameterProperty, ArrayProperty
  from neupy.algorithms.base import BaseNetwork
label_desc: Use image node_id 1 for calling the BaseStepAssociative obj's underlying member method code with example usage: obj.init_weights() without return types