We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
p.random.RandomState(self.password_wm).shuffle(wm_index) 这行代码会原地打乱 wm_index。 接着,wm_avg[wm_index] = wm_avg.copy() 这行尝试用打乱后的 wm_index 来索引 wm_avg 并将其赋值为 wm_avg 的一个副本。这里的逻辑有误。这行代码的结果是,wm_avg 的值会按照 wm_index 的新顺序被赋值,但赋的值却是原始 wm_avg 的顺序的拷贝,这样做实际上并没有根据 wm_index 来“解密”或重置 wm_avg 的顺序。 改正如下:
def extract_decrypt(self, wm_avg): wm_index = np.arange(self.wm_size) np.random.RandomState(self.password_wm).shuffle(wm_index) decrypted_wm = np.zeros_like(wm_avg) decrypted_wm[wm_index] = wm_avg # 根据打乱的索引恢复顺序 return decrypted_wm
The text was updated successfully, but these errors were encountered:
No branches or pull requests
p.random.RandomState(self.password_wm).shuffle(wm_index) 这行代码会原地打乱 wm_index。
接着,wm_avg[wm_index] = wm_avg.copy() 这行尝试用打乱后的 wm_index 来索引 wm_avg 并将其赋值为 wm_avg 的一个副本。这里的逻辑有误。这行代码的结果是,wm_avg 的值会按照 wm_index 的新顺序被赋值,但赋的值却是原始 wm_avg 的顺序的拷贝,这样做实际上并没有根据 wm_index 来“解密”或重置 wm_avg 的顺序。
改正如下:
The text was updated successfully, but these errors were encountered: