-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#TODO this does NOT work; `parameters` are not required to be Ordered Dictionary | ||
paramfile = open("parameters.dat") | ||
parameters = Meta.parse.(readlines(paramfile)) | ||
close(paramfile) | ||
|
||
f(t) = parameters[1] * t - parameters[2] # a * t - b; linear model | ||
times = 1:4 | ||
predictions = map(f, times) | ||
|
||
predicfile = open("predictions.dat", "w") | ||
for prediction in predictions | ||
write(predicfile, string(prediction, "\n")) | ||
end | ||
close(predicfile) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Parameters: | ||
- a : { longname: "parameter a", init: 1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- b : { longname: "parameter b", init: -1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
Observations: | ||
- o1: { longname: "observation 1", log: false, max: 20, min: -20, target: -3, weight: 1} | ||
- o2: { longname: "observation 2", log: false, max: 20, min: -20, target: 1, weight: 1} | ||
- o3: { longname: "observation 3", log: false, max: 20, min: -20, target: 5, weight: 1} | ||
- o4: { longname: "observation 4", log: false, max: 20, min: -20, target: 9, weight: 1} | ||
Command: "julia external-linearmodel-ascii.jl" | ||
ASCIIParameters: parameters.dat | ||
ASCIIPredictions: predictions.dat |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import JLD | ||
import OrderedCollections | ||
|
||
parameters = JLD.load("parameters.jld") # JLD file created to write current model parameters | ||
JLD | ||
f(t) = parameters["a"] * t - parameters["b"] # a * t - b; linear model | ||
times = 1:4 | ||
predictions = OrderedCollections.OrderedDict(zip(map(i -> string("o", i), times), map(f, times))) | ||
|
||
JLD.save("predictions.jld", predictions) # JLD file created to write current model predictions |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Parameters: | ||
- a : { longname: "parameter a", init: 1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- b : { longname: "parameter b", init: -1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- c : { longname: "parameter b", init: -1, type: null, log: no, step: 0.1, min: -10, max: 10 } | ||
Observations: | ||
- o1: { longname: "observation 1", log: false, max: 20, min: -20, target: -3, weight: 1} | ||
- o2: { longname: "observation 2", log: false, max: 20, min: -20, target: 1, weight: 1} | ||
- o3: { longname: "observation 3", log: false, max: 20, min: -20, target: 5, weight: 1} | ||
- o4: { longname: "observation 4", log: false, max: 20, min: -20, target: 9, weight: 1} | ||
Command: "julia external-linearmodel-jld.jl" | ||
JLDParameters: parameters.jld | ||
JLDPredictions: | ||
- predictions.jld |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import JLD2 | ||
import OrderedCollections | ||
|
||
parameters = JLD2.load("parameters.jld2") # JLD file created to write current model parameters | ||
|
||
f(t) = parameters["a"] * t - parameters["b"] # a * t - b; linear model | ||
times = 1:4 | ||
predictions = OrderedCollections.OrderedDict(zip(map(i -> string("o", i), times), map(f, times))) | ||
|
||
JLD2.save("predictions.jld2", predictions) # JLD file created to write current model predictions |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Parameters: | ||
- a : { longname: "parameter a", init: 1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- b : { longname: "parameter b", init: -1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- c : { longname: "parameter b", init: -1, type: null, log: no, step: 0.1, min: -10, max: 10 } | ||
Observations: | ||
- o1: { longname: "observation 1", log: false, max: 20, min: -20, target: -3, weight: 1} | ||
- o2: { longname: "observation 2", log: false, max: 20, min: -20, target: 1, weight: 1} | ||
- o3: { longname: "observation 3", log: false, max: 20, min: -20, target: 5, weight: 1} | ||
- o4: { longname: "observation 4", log: false, max: 20, min: -20, target: 9, weight: 1} | ||
Command: "julia external-linearmodel-jld2.jl" | ||
JLDParameters: parameters.jld2 | ||
JLDPredictions: | ||
- predictions.jld2 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Parameters: | ||
- a : { longname: "parameter a", init: 1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- b : { longname: "parameter b", exp: a*-1 } | ||
Observations: | ||
- o1: { longname: "observation 1", log: false, max: 20, min: -20, target: -3, weight: 1} | ||
- o2: { longname: "observation 2", log: false, max: 20, min: -20, target: 1, weight: 1} | ||
- o3: { longname: "observation 3", log: false, max: 20, min: -20, target: 5, weight: 1} | ||
- o4: { longname: "observation 4", log: false, max: 20, min: -20, target: 9, weight: 1} | ||
Command: "julia external-linearmodel-json.jl" | ||
JSONParameters: parameters.json | ||
JSONPredictions: | ||
- predictions.json |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import JSON | ||
import OrderedCollections | ||
|
||
parameters = JSON.parsefile("parameters.json") | ||
@show parameters | ||
|
||
f(t) = parameters["a"] * t - parameters["b"] # a * t - b; linear model | ||
times = 1:4 | ||
@show map(i -> string("o", i), times), map(f, times) | ||
predictions = OrderedCollections.OrderedDict(zip(map(i -> string("o", i), times), map(f, times))) | ||
|
||
@show predictions | ||
jo = open("predictions.json", "w") | ||
JSON.print(jo, predictions) | ||
close(jo) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Parameters: | ||
- a : { longname: "parameter a", init: 1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- b : { longname: "parameter b", init: -1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
Observations: | ||
- o1: { longname: "observation 1", log: false, max: 20, min: -20, target: -3, weight: 1} | ||
- o2: { longname: "observation 2", log: false, max: 20, min: -20, target: 1, weight: 1} | ||
- o3: { longname: "observation 3", log: false, max: 20, min: -20, target: 5, weight: 1} | ||
- o4: { longname: "observation 4", log: false, max: 20, min: -20, target: 9, weight: 1} | ||
Command: "julia external-linearmodel-json.jl" | ||
JSONParameters: parameters.json | ||
JSONPredictions: | ||
- predictions.json |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
internal-linearmodel-parameters.inst |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
internal-linearmodel-parameters.tpl |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import OrderedCollections | ||
import YAML | ||
|
||
parameters = YAML.load("parameters.yaml") | ||
if isfile(parameters) | ||
parameters = YAML.load_file(parameters) | ||
end | ||
|
||
f(t) = parameters["a"] * t - parameters["b"] # a * t - b; linear model | ||
times = 1:4 | ||
predictions = OrderedCollections.OrderedDict(zip(map(i -> string("o", i), times), map(f, times))) | ||
|
||
@show predictions | ||
YAML.write_file("predictions.yaml", predictions) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Parameters: | ||
- a : { longname: "parameter a", init: 1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- b : { longname: "parameter b", init: -1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- c : { longname: "parameter b", init: -1, type: null, log: no, step: 0.1, min: -10, max: 10 } | ||
Observations: | ||
- o1: { longname: "observation 1", log: false, max: 20, min: -20, target: -3, weight: 1} | ||
- o2: { longname: "observation 2", log: false, max: 20, min: -20, target: 1, weight: 1} | ||
- o3: { longname: "observation 3", log: false, max: 20, min: -20, target: 5, weight: 1} | ||
- o4: { longname: "observation 4", log: false, max: 20, min: -20, target: 9, weight: 1} | ||
Command: "julia external-linearmodel-yaml.jl" | ||
YAMLParameters: parameters.yaml | ||
YAMLPredictions: | ||
- predictions.yaml |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../models/internal-linear-model/internal-linearmodel.jl |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../models/internal-linear-model/internal-linearmodel.mads |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../models/internal-linear-model/internal-linearmodel.jl |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../models/internal-linear-model/internal-linearmodel.mads |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#TODO this does NOT work; `parameters` are not required to be Ordered Dictionary | ||
paramfile = open("parameters.dat") | ||
parameters = Meta.parse.(readlines(paramfile)) | ||
close(paramfile) | ||
|
||
f(t) = parameters[1] * t - parameters[2] # a * t - b; linear model | ||
times = 1:4 | ||
predictions = map(f, times) | ||
|
||
predicfile = open("predictions.dat", "w") | ||
for prediction in predictions | ||
write(predicfile, string(prediction, "\n")) | ||
end | ||
close(predicfile) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Parameters: | ||
- a : { longname: "parameter a", init: 1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
- b : { longname: "parameter b", init: -1, type: opt, log: no, step: 0.1, min: -10, max: 10 } | ||
Observations: | ||
- o1: { longname: "observation 1", log: false, max: 20, min: -20, target: -3, weight: 1} | ||
- o2: { longname: "observation 2", log: false, max: 20, min: -20, target: 1, weight: 1} | ||
- o3: { longname: "observation 3", log: false, max: 20, min: -20, target: 5, weight: 1} | ||
- o4: { longname: "observation 4", log: false, max: 20, min: -20, target: 9, weight: 1} | ||
Command: "julia external-linearmodel-ascii.jl" | ||
ASCIIParameters: parameters.dat | ||
ASCIIPredictions: predictions.dat |