local_counter = self.sample_counter
# 2: Put sample in the job pool
- computation = {}
- computation["method"] = "Tangent"
- computation["data"] = X
- computation = pickle.dumps(computation)
- self.optim_algo.pool.pushInSample(local_counter, computation)
+ sample = self.create_sample(X, "Tangent")
+ self.optim_algo.pool.pushInSample(local_counter, sample)
# 3: Wait
while 1:
local_counter = self.sample_counter
# 2: Put sample in the job pool
- computation = {}
- computation["method"] = "Adjoint"
- computation["data"] = (X, Y)
- computation = pickle.dumps(computation)
- self.optim_algo.pool.pushInSample(local_counter, computation)
+ sample = self.create_sample(Y, "Tangent")
+ self.optim_algo.pool.pushInSample(local_counter, sample)
# 3: Wait
while 1:
if param["name"] == "method":
method = param["value"]
print "Method found is", method
+print computation["inputValues"]
+print computation["inputValues"][0][0]
dimension = 300
H = numpy.matrix(numpy.core.identity(dimension))
return H.T * Y
if method == "Direct":
- result = FunctionH(computation["data"])
+ result = FunctionH(numpy.matrix(computation["inputValues"][0][0]).T)
if method == "Tangent":
- result = FunctionH(computation["data"])
+ result = FunctionH(numpy.matrix(computation["inputValues"][0][0]).T)
if method == "Adjoint":
- result = AdjointH(computation["data"])
+ result = AdjointH(numpy.matrix(computation["inputValues"][0][0]).T)
print "Computation end"