diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..78e8a86 --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Anonymous Authors + +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. diff --git a/README.md b/README.md index 91572a5..e9488f0 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,5 @@ conda env create -f environment.yml conda activate nas-wot ./reproduce.sh ``` + +The code is licensed under the MIT licence. diff --git a/reproduce.sh b/reproduce.sh index 83bbd73..d23c495 100644 --- a/reproduce.sh +++ b/reproduce.sh @@ -1,4 +1,4 @@ -python search.py --dataset cifar10 -python search.py --dataset cifar10 --trainval -python search.py --dataset cifar100 -python search.py --dataset ImageNet16-120 +python search.py --dataset cifar10 --data_loc '../datasets/cifar10' +python search.py --dataset cifar10 --trainval --data_loc '../datasets/cifar10' +python search.py --dataset cifar100 --data_loc '../datasets/cifar100' +python search.py --dataset ImageNet16-120 --data_loc '../datasets/ImageNet16' diff --git a/search.py b/search.py index cbb5416..c523720 100644 --- a/search.py +++ b/search.py @@ -55,7 +55,7 @@ def get_batch_jacobian(net, x, target, to, device, args=None): return jacob, target.detach() -def evidenceapprox_eval_score(jacob, labels=None): +def eval_score(jacob, labels=None): corrs = np.corrcoef(jacob) v, _ = np.linalg.eig(corrs) k = 1e-5 @@ -122,7 +122,7 @@ for N in runs: jacobs = jacobs.reshape(jacobs.size(0), -1).cpu().numpy() try: - s = evidenceapprox_eval_score(jacobs, labels) + s = eval_score(jacobs, labels) except Exception as e: print(e) s = np.nan