code: def get_projection(fin, fout, method="ortho"):
      if "sample" == method:
          W = paddle.randperm(fin)[:fout]
          # W = paddle.eye(fin)[W.tolist()].T
      elif "coreset" == method:
          W = None
      elif "h_sample" == method:
          s = (
              paddle.randperm(fin // 7)[: fout // 3].tolist()
              + (
                  fin // 7 + paddle.randperm(fin // 7 * 2)[: fout // 3]
              ).tolist()
              + (
                  fin // 7 * 3
                  + paddle.randperm(fin // 7 * 4)[
                      : (fout - fout // 3 * 2)
                  ]
              ).tolist()
          )
          W = paddle.eye(fin)[s].T
      elif "ortho" == method:
          W = orthogonal(fin, fout)
      elif "svd_ortho" == method:
          W = svd_orthogonal(fin, fout)
      elif "gaussian" == method:
          W = paddle.randn(fin, fout)
      return W
  
imports: import numpy
  from tqdm import tqdm
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.vision.models.resnet import resnet18, resnet50, wide_resnet50_2
  from scipy.ndimage import gaussian_filter
  from qinspector.cvlib.workspace import register
  from qinspector.uad.utils.utils import cdist, cholesky_inverse, mahalanobis, mahalanobis_einsum, orthogonal, svd_orthogonal
  from qinspector.uad.utils.k_center_greedy import KCenterGreedy
label_desc: Use image node_id 1 for calling a global function with example usage: get_projection(fin, fout, method) and returns: W