コード例 #1
0
ファイル: RLS.py プロジェクト: jmread/cerebro
 def predict(self,x):
     '''
         Predict p(y|x) = f(x;w)
         ------------------------
         NOTE: this 'activation' is simply the dot product for OLS, 
         however, for more advanced, e.g., two-layered networks, it's not so straightforward;
         we need to be careful with internal memory variables like z.
     '''
     return self.f(activation(self.w,x)) #return self.f(dot(self.w,x))
コード例 #2
0
ファイル: RLS.py プロジェクト: jmread/cerebro
def F_sigmoid(w,x):
    '''
        should return M * L matrix given by the linearization of f(w'x)
    '''
    df = dsigmoid(activation(w,x)) * x   # where activation = (dot(self.w,x))
    return df #* (w - w_0)