Skip to content

Commit

Permalink
Merge pull request #222 from MIT-AI-Accelerator/gnadt
Browse files Browse the repository at this point in the history
Gnadt
  • Loading branch information
gnadt authored Sep 2, 2023
2 parents c41f133 + ecf9ece commit 4d38e8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 3 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ This work is created by the Department of the Air Force under 17 U.S.C. 105. Thi

When reproducing, copying, modifying, or creating derivative works, the portion(s) of the work attributable under 17 U.S.C. 105 may be designated with the above notice where appropriate. Improperly claiming ownership of this work could be punishable by law under 17 U.S.C. 506(c).

The above copyright notice and this permission notice should be included in all copies or substantial portions of the work.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 changes: 10 additions & 12 deletions test/test_compensation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ comp_params_2d = NNCompParams(model_type=:m2d ,terms=terms_p,
terms_A=terms_pie,TL_coef=TL_coef_pie,
batchsize=batchsize,epoch_adam=epoch_adam)
comp_params_3tl = NNCompParams(model_type=:m3tl,terms=terms_pi,
terms_A=terms_pie,TL_coef=TL_coef_pie,
terms_A=terms_pieb,TL_coef=TL_coef_pie,
batchsize=batchsize,epoch_adam=epoch_adam)
comp_params_3s = NNCompParams(model_type=:m3s ,terms=terms_pi,
terms_A=terms_pie,TL_coef=TL_coef_pie,
terms_A=terms_pieb,TL_coef=TL_coef_pie,
batchsize=batchsize,epoch_adam=epoch_adam)
comp_params_3v = NNCompParams(model_type=:m3v ,terms=terms_pi,
terms_A=terms_pie,TL_coef=TL_coef_pie,
terms_A=terms_pieb,TL_coef=TL_coef_pie,
batchsize=batchsize,epoch_adam=epoch_adam)
comp_params_3sc = NNCompParams(model_type=:m3sc,terms=terms_pi,
terms_A=terms_pie,TL_coef=TL_coef_pie,
Expand Down Expand Up @@ -268,15 +268,11 @@ comp_params_3tl = NNCompParams(comp_params_3tl,
frac_train = frac_train)

comp_params_3s = NNCompParams(comp_params_3s,
terms_A = terms_pieb,
TL_coef = [comp_params_3s.TL_coef;0],
epoch_lbfgs = epoch_lbfgs,
k_pca = k_pca_big,
frac_train = frac_train)

comp_params_3v = NNCompParams(comp_params_3v,
terms_A = terms_pieb,
TL_coef = [comp_params_3v.TL_coef;0],
epoch_lbfgs = epoch_lbfgs,
k_pca = k_pca_big,
frac_train = frac_train)
Expand All @@ -301,6 +297,8 @@ x = [1:5;][:,:]
y = [1:5;]

@testset "comp_train tests" begin
@test std(MagNav.elasticnet_fit(x,y;λ=0.01,silent)[end]) < 1
@test isone(MagNav.plsr_fit(x,y;return_set=true,silent)[:,:,1])
@test std(comp_train(xyz,ind;comp_params=comp_params_1,
xyz_test=xyz,ind_test=ind,silent)[end-1]) < 1
@test std(comp_train([xyz,xyz],[ind,ind];comp_params=comp_params_1,
Expand Down Expand Up @@ -334,13 +332,11 @@ y = [1:5;]
@test std(comp_train([xyz,xyz],[ind,ind];comp_params=comp_params_plsr,
xyz_test=xyz,ind_test=ind,silent)[end-1]) < 1
@test std(comp_train([xyz,xyz],[ind,ind];comp_params=comp_params_1_drop,
xyz_test=xyz,ind_test=ind,silent)[end-1]) < 1
xyz_test=xyz,ind_test=ind,silent=false)[end-1]) < 1
@test std(comp_train([xyz,xyz],[ind,ind];comp_params=comp_params_2c_drop,
xyz_test=xyz,ind_test=ind,silent)[end-1]) < 1
xyz_test=xyz,ind_test=ind,silent=false)[end-1]) < 1
@test std(comp_train([xyz,xyz],[ind,ind];comp_params=comp_params_3s_drop,
xyz_test=xyz,ind_test=ind,silent)[end-1]) < 1
@test isone(MagNav.plsr_fit(x,y;return_set=true,silent)[:,:,1])
@test std(MagNav.elasticnet_fit(x,y;λ=0.01,silent)[end]) < 1
xyz_test=xyz,ind_test=ind,silent=false)[end-1]) < 1
@test_throws ErrorException comp_train([xyz,xyz],[ind,ind];
comp_params=comp_params_nn_bad,silent)
@test_throws AssertionError comp_train([xyz,xyz],[ind,ind];
Expand Down Expand Up @@ -368,6 +364,8 @@ y = [1:5;]
end

@testset "comp_test tests" begin
@test std(comp_test(xyz,ind;comp_params=comp_params_3sc, silent)[end-1]) < 50
@test std(comp_test(line,df_line,df_flight,df,comp_params_3vc;silent)[end-1]) < 50
@test_throws ErrorException comp_test(xyz,ind;
comp_params=comp_params_nn_bad,silent)
@test_throws ErrorException comp_test(xyz,ind;
Expand Down

0 comments on commit 4d38e8f

Please sign in to comment.