Skip to content

Commit

Permalink
Clarifying requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalmanifold committed Nov 5, 2024
1 parent 5e2c7a6 commit ee43d11
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 47 deletions.
8 changes: 2 additions & 6 deletions opm/ml/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
These ML modules are heavily modifiying and extending the previous wok done in Kerasify by Maevskikh and Rose. Kerasify is a library for running trained Keras models from a C++ platform. Our implementation is also compliant with the automatic differentiation approach used in OPM. The implementation works with Python v.3.9.0 and above.
These ML modules are heavily modifiying and extending the previous work done in Kerasify by Maevskikh and Rose. Kerasify is a library for running trained Keras models from a C++ platform. Our implementation is also compliant with the automatic differentiation approach used in OPM. The implementation works with Python v.3.9.0 and above (up to <=3.12.0).


-Unit tests are generated by:
Expand All @@ -19,8 +19,4 @@ TEST dense_10x10x10
TEST relu_10
TEST dense_relu_10
TEST dense_tanh_10
TEST scalingdense_10x1




TEST scalingdense_10x1
8 changes: 2 additions & 6 deletions python/opm/ml/ml_tools/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
These ML modules are heavily modifiying and extending the previous wok done in Kerasify by Maevskikh and Rose. Kerasify is a library for running trained Keras models from a C++ platform. Our implementation is also compliant with the automatic differentiation approach used in OPM. The implementation works with Python v.3.9.0 and above.
These ML modules are heavily modifiying and extending the previous work done in Kerasify by Maevskikh and Rose. Kerasify is a library for running trained Keras models from a C++ platform. Our implementation is also compliant with the automatic differentiation approach used in OPM. The implementation works with Python v.3.9.0 and above (up to <=3.12.0).


-Unit tests are generated by:
Expand All @@ -19,8 +19,4 @@ TEST dense_10x10x10
TEST relu_10
TEST dense_relu_10
TEST dense_tanh_10
TEST scalingdense_10x1




TEST scalingdense_10x1
2 changes: 1 addition & 1 deletion python/opm/ml/ml_tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################
# Python v.3.9.0 and above
python>=3.9.0
python>=3.9.0<=3.12.0

################################################################
# Numpy 1.23.0 and above
Expand Down
8 changes: 2 additions & 6 deletions tests/ml/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
These ML modules are heavily modifiying and extending the previous wok done in Kerasify by Maevskikh and Rose. Kerasify is a library for running trained Keras models from a C++ platform. Our implementation is also compliant with the automatic differentiation approach used in OPM. The implementation works with Python v.3.9.0 and above.
These ML modules are heavily modifiying and extending the previous work done in Kerasify by Maevskikh and Rose. Kerasify is a library for running trained Keras models from a C++ platform. Our implementation is also compliant with the automatic differentiation approach used in OPM. The implementation works with Python v.3.9.0 and above (up to <=3.12.0).


-Unit tests are generated by:
Expand All @@ -19,8 +19,4 @@ TEST dense_10x10x10
TEST relu_10
TEST dense_relu_10
TEST dense_tanh_10
TEST scalingdense_10x1




TEST scalingdense_10x1
6 changes: 3 additions & 3 deletions tests/ml/ml_tools/include/test_dense_10x1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ bool test_dense_10x1(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{10};
in.data_ = {0.33128357,0.5507012,0.089097455,0.9930643,0.3021132,0.44296286,
0.77584934,0.5803623,0.6916559,0.48866668};
in.data_ = {0.7525359,0.41793406,0.49476823,0.12790717,0.94876474,0.87958586,
0.86211944,0.33709556,0.66815335,0.4976565};

Opm::Tensor<Evaluation> out{1};
out.data_ = {-0.59224933};
out.data_ = {1.0386434};

NNTimer load_timer;
load_timer.start();
Expand Down
6 changes: 3 additions & 3 deletions tests/ml/ml_tools/include/test_dense_10x10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ bool test_dense_10x10(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{10};
in.data_ = {0.3796144,0.83585316,0.19076388,0.029881366,0.9120564,0.53910017,
0.9167442,0.4047214,0.36840722,0.06841394};
in.data_ = {0.5401406,0.067625806,0.013277436,0.6826751,0.6979555,0.19329886,
0.20994096,0.30320448,0.58662874,0.9045795};

Opm::Tensor<Evaluation> out{1};
out.data_ = {-0.13820542};
out.data_ = {-0.007366171};

NNTimer load_timer;
load_timer.start();
Expand Down
8 changes: 4 additions & 4 deletions tests/ml/ml_tools/include/test_dense_10x10x10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ bool test_dense_10x10x10(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{10};
in.data_ = {0.5663459,0.6742576,0.34646514,0.6197347,0.94704074,0.03651024,
0.14706604,0.21582149,0.6058318,0.33997878};
in.data_ = {0.3968442,0.90487117,0.40734062,0.5499472,0.78145903,0.28273746,
0.85433227,0.40486962,0.14386918,0.40355825};

Opm::Tensor<Evaluation> out{10};
out.data_ = {0.15782323,0.26536155,0.014020069,-0.12612823,0.41744298,
-0.6301674,-0.026504815,0.36927527,-0.14409286,0.4722299};
out.data_ = {-0.16558985,-0.45187443,-0.12641914,-1.0978366,-0.7226945,
-0.6645357,0.039123267,0.80385983,0.34996432,-0.8906912};

NNTimer load_timer;
load_timer.start();
Expand Down
4 changes: 2 additions & 2 deletions tests/ml/ml_tools/include/test_dense_2x2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ bool test_dense_2x2(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{2};
in.data_ = {0.9670195,0.3782521};
in.data_ = {0.44628727,0.7374128};

Opm::Tensor<Evaluation> out{1};
out.data_ = {-0.12220664};
out.data_ = {-0.652056};

NNTimer load_timer;
load_timer.start();
Expand Down
8 changes: 4 additions & 4 deletions tests/ml/ml_tools/include/test_dense_relu_10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ bool test_dense_relu_10(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{10};
in.data_ = {0.07037717,0.961961,0.116212614,0.07929625,0.35780948,0.58790404,
0.15457754,0.8093645,0.18359734,0.5857788};
in.data_ = {0.38680786,0.0730685,0.7127973,0.8082671,0.82277405,0.47305584,
0.3803484,0.524139,0.27501586,0.26343557};

Opm::Tensor<Evaluation> out{10};
out.data_ = {0.041210767,0.020567391,0.13336869,0.,0.,0.07310894,
0.,0.075157285,0.16298258,0.};
out.data_ = {0.,0.028542891,0.,0.,0.,0.034063246,
0.24708179,0.,0.,0.24706045};

NNTimer load_timer;
load_timer.start();
Expand Down
8 changes: 4 additions & 4 deletions tests/ml/ml_tools/include/test_dense_tanh_10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ bool test_dense_tanh_10(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{10};
in.data_ = {0.0036774194,0.84451723,0.54717904,0.3704365,0.3736782,
0.30650887,0.49595013,0.83192986,0.9395368,0.4966029};
in.data_ = {0.7361898,0.36718804,0.75707453,0.06566061,0.73334914,0.21434921,
0.054505836,0.25305173,0.2328151,0.9042742};

Opm::Tensor<Evaluation> out{10};
out.data_ = {0.35694593,-0.3102012,0.5760354,0.3260835,0.09098823,-0.34132,
-0.08773771,-0.33041546,-0.1178762,-0.22991908};
out.data_ = {-0.5305012,0.0042109145,-0.5056327,0.32147372,-0.41129827,
0.45075068,0.34022546,0.5919749,-0.67698103,0.3951862};

NNTimer load_timer;
load_timer.start();
Expand Down
8 changes: 4 additions & 4 deletions tests/ml/ml_tools/include/test_relu_10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ bool test_relu_10(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{10};
in.data_ = {0.4814067,0.7162516,0.731281,0.6096687,0.2502829,0.44564644,
0.15723701,0.93854994,0.39685968,0.07241595};
in.data_ = {0.11478948,0.9410835,0.28376904,0.25726688,0.9882219,0.21069573,
0.98714674,0.018556545,0.13675344,0.28590667};

Opm::Tensor<Evaluation> out{10};
out.data_ = {0.8344329,0.15581068,0.,0.,0.14855057,0.,
0.2895283,0.,0.,0.19160327};
out.data_ = {0.,0.,0.,0.,0.066772744,0.,
0.,0.,0.28074092,0.6897066};

NNTimer load_timer;
load_timer.start();
Expand Down
8 changes: 4 additions & 4 deletions tests/ml/ml_tools/include/test_scalingdense_10x1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ bool test_scalingdense_10x1(Evaluation* load_time, Evaluation* apply_time)
OPM_ERROR_IF(!apply_time, "Invalid Evaluation");

Opm::Tensor<Evaluation> in{10};
in.data_ = {0.4462127,0.8282716,0.19106287,0.46530953,0.8019146,0.6105967,
0.69855976,0.7211706,0.116201125,0.49067858};
in.data_ = {0.63939136,0.22313766,0.63712895,0.42027617,0.71234393,0.7912657,
0.045848373,0.17004263,0.8268512,0.9074378};

Opm::Tensor<Evaluation> out{10};
out.data_ = {519.3525,665.1217,690.99927,413.76526,739.2478,407.98572,631.28186,
505.1883,526.25494,696.9934};
out.data_ = {724.7656,671.29944,675.7462,612.603,769.7373,857.1875,772.3861,
638.7655,600.45886,658.24365};

NNTimer load_timer;
load_timer.start();
Expand Down
Binary file modified tests/ml/ml_tools/models/test_dense_10x1.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_dense_10x10.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_dense_10x10x10.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_dense_1x1.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_dense_2x2.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_dense_relu_10.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_dense_tanh_10.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_relu_10.model
Binary file not shown.
Binary file modified tests/ml/ml_tools/models/test_scalingdense_10x1.model
Binary file not shown.

0 comments on commit ee43d11

Please sign in to comment.