argmax(np.bincount(area_ids[list(neis)])) return pimms.imm_array(np.asarray(area_ids, dtype=np.int)) Example #21Source File: test_attacks.py From neural-fingerprinting with BSD 3-Clause "New" or "Revised" License 6 votes def test_generate_np_targeted_gives_adversarial_example(self):...
apply_along_axis( lambda x: np.argmax(np.bincount(x, weights=self.weights)), axis=1, arr=predictions) maj_vote = self.lablenc_.inverse_transform(maj_vote) return maj_vote 浏览完整代码 来源:majority_voting.py 项目:prakharchoudhary/fun_with_python 示例2 def get_batch(self, model, batch...
# 需要导入模块: from keras import backend [as 别名]# 或者: from keras.backend importargmax[as 别名]defcall(self, inputs, **kwargs):iftype(inputs)islist:# true label is provided with shape = [None, n_classes], i.e. one-hot code.assertlen(inputs) ==2inputs, mask = inputselse...