code: def _var_res_to_weights(self, var_res):
          
          # transform the weights into our form
          motif_base_weights_raw = var_res["motif_base_weights"][0]
          motif_base_weights = np.swapaxes(motif_base_weights_raw, 0, 2)
  
          # get weights
          motif_weights = var_res["motif_weights"]
          motif_bias = var_res["motif_bias"]
          final_bias = var_res["final_bias"]
          feature_weights = var_res["feature_weights"]
  
          # get the GAM prediction:
          spline_pred = None
          spline_weights = None
          if self._param["n_splines"] is not None:
              spline_pred = self._splines["X_spline"].dot(var_res["spline_weights"])
  
              if self._param["spline_exp"] is True:
                  spline_pred = np.exp(spline_pred)
              else:
                  spline_pred = (spline_pred + 1)
  
              spline_pred.reshape([-1])
              spline_weights = var_res["spline_weights"]
  
          weights = {"motif_base_weights": motif_base_weights,
                     "motif_weights": motif_weights,
                     "motif_bias": motif_bias,
                     "final_bias": final_bias,
                     "feature_weights": feature_weights,
                     "spline_pred": spline_pred,
                     "spline_weights": spline_weights
                     }
          return weights
docs: Get model weights