Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Love The Tool #18

Open
tclayton0594 opened this issue Sep 5, 2019 · 10 comments
Open

Love The Tool #18

tclayton0594 opened this issue Sep 5, 2019 · 10 comments

Comments

@tclayton0594
Copy link

Hi Again,

I had posted a quick question that you guys were quick to help me debug (very much appreciated) and I was able to use exact-star to get some very promising results. We had been trying a few other reachable set solvers and have found this one to be one of the best. I was wondering if you guys had any sort of timeline/were still working on the activation functions that your solver allows. I know on your home page you mention using tanh/sigmoid as well. It would be really helpful to my team (Next Gen Controls at GM) if it did have this flexibility, especially with tanh as it is MATLAB's default and tends to give best performance on our nets.

Thanks,
Taylor

@trhoangdung
Copy link
Collaborator

Hi Taylor,

Thank you very much for your compliment. It encourages us to do a better job for CPS + ML verification. Our tool currently supports tanh and sigmoid. If you want to know how to use it, please send us a toy example and we will write an example code for you.

Best,

Tran

@ttj
Copy link
Contributor

ttj commented Sep 6, 2019

Thanks for the positive feedback, we appreciate it and are glad to hear you've found it useful!

We'll also work on a simple overall illustrative example with tanh/sigmoid in a network, but for now, you can see some usage in the existing tests for these, albeit it's not in a full network:

https://github.com/verivital/nnv/blob/master/nnv/tests/nn/fnn/logsig/test_LogSig_reach_star_approx.m

https://github.com/verivital/nnv/blob/master/nnv/tests/nn/fnn/tansig/test_TanSig_reach_star_approx.m

Sorry, the above links are now broken due to a recent repository restructuring, these should work:

https://github.com/verivital/nnv/blob/master/code/nnv/tests/nn/fnn/tansig/test_TanSig_reach_star_approx.m

https://github.com/verivital/nnv/blob/master/code/nnv/tests/nn/fnn/logsig/test_LogSig_reach_star_approx.m

@tclayton0594
Copy link
Author

tclayton0594 commented Sep 13, 2019

Awesome! I have time now to explore so will see if I can figure it out or I will be reaching out for additional support.

@tclayton0594
Copy link
Author

How could I send you toy data that you would be able to write example code for me in case I can't get it working?

@ttj
Copy link
Contributor

ttj commented Sep 13, 2019

A network in a reasonable format (ONNX, Keras, matlab, etc.) would be easiest. If that's not possible, training data also could be fine as long as the overall training process is clear.

If it's fine to publicly share, you can add as an attachment to the issue, make a pull request, etc. If it's not, you can email us directly, our contact info should be available from the readme.

@tclayton0594
Copy link
Author

Ok I am going to make a basic example in Matlab on one of their sample datasets and then post publicly then. I will include the trained model as a .mat file and in there I will also include the input and output sets as well.

@tclayton0594
Copy link
Author

I attached a zip file with a .mat file in it. The ANN has 2 hidden layers and 10 neurons each. In the mat file, I also saved the inputs lower and upper bounds. I did not apply normalization pre-training but MATLAB does use mapminmax by default to map inputs between -1 and 1. Please let me know if you need anything else.
Toy_Tansig.zip

@trhoangdung
Copy link
Collaborator

trhoangdung commented Sep 13, 2019 via email

@trhoangdung
Copy link
Collaborator

Hi Taylor,

Please find the analysis code for your example here: https://github.com/verivital/nnv/tree/master/code/nnv/examples/NN/Toy_TanSig

Please clone the newest version of nnv to run the code and let me know if you have any question.

load Engine_Toy_Tansig_net.mat;

nnvNet = FFNNS.parse(net); % parse the network trained from matlab

lb = [-1; -1];
ub = [1; 1];

I = Star(lb, ub);

fprintf('\nReachable set of the toy network:\n');
reachSet = nnvNet.reach(I, 'approx-star') % perform reachability analyis using approx-star

fprintf('\nRange of the output of the toy network:\n');
B = reachSet.getBox % get the output range

Best,

Tran

@tclayton0594
Copy link
Author

Awesome, thanks a bunch Tran. I will let you know if I have any issues.

ttj pushed a commit that referenced this issue Jan 30, 2020
merge recent changes for CAV submission
ttj pushed a commit that referenced this issue Apr 14, 2020
merge recent changes for CAV submission
ttj pushed a commit that referenced this issue Jun 30, 2021
VNN and ARCH competitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants