text: Title: [MNT] Replace assertions in networks module with raising Value errors
  Body: ### Describe the issue
  
  In all networks module, the parameters handled as input lists have an assertion for the length of the list, but assertions are not a good idea, they should be replaced by raise ValueError message
  
  ### Suggest a potential alternative/fix
  
  Example
  
  instead of:
  ```Python
  assert len(self.strides) == self.n_conv_per_residual_block
  ```
  It should be :
  
  ```Python
  if len(self.strides) != self.n_conv_per_residual_block:
      raise ValueError(
          f"Number of strides {len(self.strides)} should be"
          f" the same as number of convolution layers per block but is"
          f" not: {self.n_conv_per_residual_block}."
      )
  ```
  
  ### Additional context
  
  _No response_