Merge branch 'master' of github.com:BayesWatch/nas-without-training
This commit is contained in:
		
							
								
								
									
										21
									
								
								LICENCE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								LICENCE
									
									
									
									
									
										Normal file
									
								
							| @@ -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. | ||||
| @@ -12,3 +12,5 @@ conda env create -f environment.yml | ||||
| conda activate nas-wot | ||||
| ./reproduce.sh | ||||
| ``` | ||||
|  | ||||
| The code is licensed under the MIT licence. | ||||
|   | ||||
| @@ -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' | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user