Browse Source

Fix an issue of check-param function

tags/v1.2.0-rc1
jin-xiulang 4 years ago
parent
commit
62532fa812
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      mindarmour/privacy/sup_privacy/sup_ctrl/conctrl.py
  2. +2
    -2
      mindarmour/utils/_check_param.py

+ 1
- 1
mindarmour/privacy/sup_privacy/sup_ctrl/conctrl.py View File

@@ -121,7 +121,7 @@ class SuppressCtrl(Cell):
self.sparse_vibra = 0.02 # the sparsity may have certain range of variations
self.sparse_valid_max_weight = 0.20 # if max network weight is less than this value, suppress operation stop temporarily
self.add_noise_thd = 0.50 # if network weight is more than this value, noise is forced
self.noise_volume = 0.01 # noise volume 0.01
self.noise_volume = 0.1 # noise volume 0.1
self.base_ground_thd = 0.0000001 # if network weight is less than this value, will be considered as 0
self.model = None # SuppressModel instance
self.grads_mask_list = [] # list for Grad Mask Matrix tensor


+ 2
- 2
mindarmour/utils/_check_param.py View File

@@ -212,8 +212,8 @@ def check_equal_shape(para_name1, value1, para_name2, value2):
if value1.shape != value2.shape:
msg = 'The shape of {0} must equal to the ' \
'{1}, but got {0} is {2}, ' \
'{1} is {3}'.format(para_name1, para_name2, value1.shape[0],
value2.shape[0])
'{1} is {3}'.format(para_name1, para_name2, value1.shape,
value2.shape)
LOGGER.error(TAG, msg)
raise ValueError(msg)
return value1, value2


Loading…
Cancel
Save