class_docstr: Penalty applied to linear transformation of parameters
  
  Parameters
  ----------
  penalty: instance of penalty function
      currently this requires an instance of a univariate, vectorized
      penalty class
  weights : None or ndarray
      weights for adding penalties of transformed params
  restriction : None or ndarray
      If it is not None, then restriction defines a linear transformation
      of the parameters. The penalty function is applied to each transformed
      parameter independently.
  
  Notes
  -----
  `restrictions` allows us to impose penalization on contrasts or stochastic
  constraints of the original parameters.
  Examples for these contrast are difference penalities or all pairs
  penalties.
class_docstr_tok: ["Penalty","applied","to","linear","transformation","of","parameters","Parameters","--","--","--","--","--","penalty",":","instance","of","penalty","function","currently","this","requires","an","instance","of","a","univariate",",","vectorized","penalty","class","weights",":","None","or","ndarray","weights","for","adding","penalties","of","transformed","params","restriction",":","None","or","ndarray","If","it","is","not","None",",","then","restriction","defines","a","linear","transformation","of","the","parameters",".","The","penalty","function","is","applied","to","each","transformed","parameter","independently",".","Notes","--","--","-","`","restrictions","`","allows","us","to","impose","penalization","on","contrasts","or","stochastic","constraints","of","the","original","parameters",".","Examples","for","these","contrast","are","difference","penalities","or","all","pairs","penalties","."]
code: def __init__(self, penalty, weights=None, restriction=None):
      self.penalty = penalty
      if weights is None:
          self.weights = 1.0
      else:
          self.weights = weights
  
      if restriction is not None:
          restriction = np.asarray(restriction)
  
      self.restriction = restriction
  
imports: import numpy
label_desc: Use image node_id 1 to create a new ConstraintsPenalty object  with example: obj = ConstraintsPenalty(penalty, weights, restriction)