code: def compute_coef(self, x, bases, coef):
      # (B * S, D, N)^T @ (B * S, D, R) -> (B * S, N, R)
      numerator = paddle.bmm(x.transpose([0, 2, 1]), bases)
      # (B * S, N, R) @ (B * S, D, R)^T @ (B * S, D, R) -> (B * S, N, R)
      denominator = coef.bmm(bases.transpose([0, 2, 1]).bmm(bases))
      # multiplication update
      coef = coef * numerator / (denominator + 1e-6)
  
      return coef
  
file_path: PaddleSeg/paddleseg/models/layers/nmf_2d.py
imports: from abc import abstractmethod, ABCMeta
  import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 4 for calling the NMF2D obj's underlying member method code with example usage: obj.compute_coef(x, bases, coef) and returns: coef