コード例 #1
0
    def CostFactory2(self,pts,datapts,nparams):
        """generates a cost function instance from datapoints 
and evaluation points"""
        F = CF()
        F.addModel(self.ForwardFactory,self.__name__,nparams)
        self.__cost__ = F.getCostFunction(evalpts=pts,observations=datapts,sigma=self.__sigma__,metric=self.__metric__)
        return self.__cost__
コード例 #2
0
ファイル: br8.py プロジェクト: mrakitin/mystic
 def CostFactory(self,target,pts):
     """generates a cost function instance from list of coefficients & evaluation points"""
     datapts = self.evaluate(target,pts)
     F = CF()
     F.addModel(self.ForwardFactory,len(target),self.__name__)
     self.__cost__ = F.getCostFunction(evalpts=pts,observations=datapts,sigma=sqrt(datapts),metric=self.__metric__)
     return self.__cost__