Commit 233f35f7 authored by Uwe Köckemann's avatar Uwe Köckemann
Browse files

Using learnd and classify to get output vector directly

parent b798e55b
......@@ -21,7 +21,7 @@ C = Container()
F = dfun.get_default_function_registry(C)
# Load example (returns URI of module)
example_module_uri = parser.parse("../..//aiddl/example-01.aiddl", C, F, ".")
example_module_uri = parser.parse("../../aiddl/example-01.aiddl", C, F)
# Fetch "examples" entry from module:
example_entry = C.get_entry(Symbolic("examples"), module=example_module_uri)
# Take value of entry:
......@@ -56,6 +56,15 @@ ls_learner_conf = parser.parse_term('''
)
''')
lap_cfg = parser.parse_term('''
(
name:LearnAndApplyFunction
module:my
class:org.aiddl.common.learning.supervised.LearnAndApplyFunction
config:{ learner:^my.LeastSquares }
)
''')
# Create function on server
dt_learner_uri = f_create.apply(dt_learner_conf)
# Create local proxy to newly created function
......@@ -66,11 +75,21 @@ mse_learner_uri = f_create.apply(ls_learner_conf)
# Create local proxy to newly created function
f_MSE = GrpcFunction(host, port, mse_learner_uri)
# Create function on server
lap_uri = f_create.apply(lap_cfg)
# Create local proxy to newly created function
f_LAP = GrpcFunction(host, port, lap_uri)
# Finally, we can apply mean square error to data:
weights = f_MSE.apply(example_data)
print("Weights:", weights)
y_k = f_LAP.apply(example_data)
print("Result:", y_k)
# Create local function to expand data and
# hook it into least squares function running on server
# class ExpandData:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment