-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from UM-Bridge/marlenaweidenauer-patch-2
Update README.md
- Loading branch information
Showing
6 changed files
with
142 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using UMBridge | ||
|
||
url = "http://localhost:4242" | ||
|
||
# Set up a model by connecting to URL and selecting the "forward" model | ||
model = UMBridge.HTTPModel("forward", url) | ||
|
||
# Print model input and output dimension | ||
print(UMBridge.model_input_sizes(model)) | ||
print(UMBridge.model_output_sizes(model)) | ||
|
||
param = [[0, 10]]; | ||
|
||
# Simple model evaluation without config | ||
val = UMBridge.evaluate(model, param, Dict()) | ||
print(val) | ||
|
||
# Model evaluation with configuration parameters | ||
config = Dict("vtk_output" => true, "level" => 1); | ||
print(UMBridge.evaluate(model, param, config)) | ||
|
||
# If model supports Jacobian action, | ||
# apply Jacobian of output zero with respect to input zero to a vector | ||
if UMBridge.supports_apply_jacobian(model) | ||
UMBridge.apply_jacobian(model, 0, 0, param, [1, 4]) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
% use matlab function addpath('') | ||
|
||
uri = 'http://localhost:4243'; | ||
|
||
% Print models supported by server | ||
umbridge_supported_models(uri) | ||
|
||
% Set up a model by connecting to URL and selecting the "posterior" model | ||
model = HTTPModel(uri,'posterior'); | ||
|
||
httpValue = model.evaluate([1, 3]) | ||
model.get_input_sizes() | ||
model.get_output_sizes() | ||
|
||
param=[0, 10.0]; | ||
|
||
% Simple model evaluation without config | ||
model.evaluate(param) | ||
|
||
%Model evaluation with configuration parameters | ||
config = struct('a', 3.9); | ||
model.evaluate(param, config) | ||
|
||
% If model supports Jacobian action, | ||
% apply Jacobian of output zero with respect to input zero to a vector | ||
if model.supports_apply_jacobian() | ||
model.apply_jacobian([1.0,4.0],param, 0, 0) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters