I need to minimize the function func(x) with randomly initialised guessed data "x"
np.random.seed(1234)
m = 500 #500
n = 100 #100
x = np.asmatrix(np.random.randint(500,1000,size=(n,1)))
def func(x):
A = np.asmatrix(np.random.randint(-10,-1, size=(n, m)))
b = np.asmatrix(np.random.randint(500,10000,size=(m,1)))
c = np.asmatrix(np.random.randint(1,10,size=(n,1)))
fx = c.transpose()*x - sum(np.log10((b - A.transpose()* x)))
return fx
sc.optimize.fmin_cg(func,y)
I am faced with this error "ValueError: shapes (1,100) and (1,100) not aligned: 100 (dim 1) != 1 (dim 0)" Not sure how scipy expects the data. I am new to scipy. It would be great if someone could point to the right direction.