class_docstr: Bilinear spatial filter.
  
  Bilinear spatial filter for SPD matrices allows to define a custom spatial
  filter for bilinear projection of the data:
  
  .. math::
      \mathbf{Cf}_i = \mathbf{V} \mathbf{C}_i \mathbf{V}^T
  
  If log parameter is set to true, will return the log of the diagonal:
  
  .. math::
      \mathbf{cf}_i = \log [ \mathrm{diag} (\mathbf{Cf}_i) ]
  
  Parameters
  ----------
  filters : ndarray, shape (n_filters, n_channels)
      The filters for bilinear transform.
  log : bool, default=False
      If true, return the log variance, otherwise return the spatially
      filtered covariance matrices.
  
  Attributes
  ----------
  filters_ : ndarray, shape (n_filters, n_channels)
      If fit, the filter components used to decompose the data for each event
      type, concatenated.
docstr: Train BilinearFilter spatial filters.
  
  Parameters
  ----------
  X : ndarray, shape (n_trials, n_channels, n_channels)
      Set of covariance matrices.
  y : ndarray, shape (n_trials,)
      Labels for each trial.
  
  Returns
  -------
  self : BilinearFilter instance
      The BilinearFilter instance.
docstr_tok: ["Train","BilinearFilter","spatial","filters",".","Parameters","--","--","--","--","--","X",":","ndarray",",","shape","(","n_trials",",","n_channels",",","n_channels",")","Set","of","covariance","matrices",".","y",":","ndarray",",","shape","(","n_trials",",",")","Labels","for","each","trial",".","Returns","--","--","--","-","self",":","BilinearFilter","instance","The","BilinearFilter","instance","."]
code: def fit(self, X, y):
      """Train BilinearFilter spatial filters.
  
      Parameters
      ----------
      X : ndarray, shape (n_trials, n_channels, n_channels)
          Set of covariance matrices.
      y : ndarray, shape (n_trials,)
          Labels for each trial.
  
      Returns
      -------
      self : BilinearFilter instance
          The BilinearFilter instance.
      """
      if not isinstance(self.filters, np.ndarray):
          raise TypeError("filters must be an array.")
      if not isinstance(self.log, bool):
          raise TypeError("log must be a boolean")
      self.filters_ = self.filters
      return self
  
imports: import warnings
  import numpy
  from scipy.linalg import eigh, inv
  from sklearn.base import BaseEstimator, TransformerMixin
  from .utils.covariance import _check_cov_est_function, normalize, get_nondiag_weight
  from .utils.mean import mean_covariance
  from .utils.ajd import ajd_pham
  from .None import estimation
  from .preprocessing import Whitening
label_desc: Use image node_id 2 for calling the BilinearFilter obj's underlying member method code with example usage: obj.fit(X, y) and returns: self