𝑥𝑥2 𝑥𝑥2 𝑓𝑓(𝑥𝑥) > 0, or Class 2 otherwise. For example,
COMP90073 – Security Analytics Week 12 Tutorial
1. Suppose that 𝑓𝑓 is a binary linear classifier 𝑓𝑓(𝑥𝑥;𝑊𝑊,𝑏𝑏) = 𝑊𝑊 ∙ 𝑥𝑥 + 𝑏𝑏, where 𝑊𝑊 = [2 −1],𝑏𝑏 = 0.5, and 𝑥𝑥 = �𝑥𝑥1�, i.e., the input x is two dimensional. Given a point 𝑥𝑥 = �𝑥𝑥1�, it will be classified into Class 1 if
(1) since 𝑓𝑓(2,1) = [2 −1]�21� + 0.5 = 3 + 0.5 = 3.5 > 0, the point (2,1) is classified into Class 1; (2) since 𝑓𝑓(−1, 1) = [2 −1] �−1� + 0.5 = −3 + 0.5 = −2.5 < 0, the point (−1, 1) is classified into
Copyright By PowCoder代写 加微信 powcoder
Generate the adversarial sample for point (1, 3) using the iterative gradient sign method. The parameters in this algorithm are given as follows: (1) the step size is fixed to 1, (2) 𝜖𝜖 = 3 – the intermediate and final results need to be clipped if necessary, to make sure that they are in the 𝜖𝜖-neighbourhood of the original point,i.e.,|𝑥𝑥𝑖𝑖 −𝑥𝑥𝑖𝑖′|≤𝜖𝜖,𝑖𝑖=1,2.
2. Use automatic differentiation to calculate the partial derivatives � 𝜕𝜕𝜕𝜕 , 𝜕𝜕𝜕𝜕 � for 𝑦𝑦 = 𝑒𝑒𝑥𝑥1 − 𝑥𝑥1/𝑥𝑥2 + 2𝑥𝑥2
atpoint(2,4). 𝜕𝜕𝑥𝑥1 𝜕𝜕𝑥𝑥2 Forward evaluation trace
𝑣𝑣=𝑥𝑥 −1 1
𝑣𝑣1 = _______ 𝑣𝑣2 = _______ 𝑣𝑣3 = _______ 𝑣𝑣4 = _______ 𝑣𝑣5 = _______ 𝑦𝑦 = 𝑣𝑣5
Forward derivative trace
×2 v3 v0 = x2
𝜕𝜕𝜕𝜕 (1) For calculating 𝜕𝜕𝑥𝑥1
𝑣𝑣̇ =𝑥𝑥̇ −1 1
v=xxx -111 2
𝑣𝑣0̇ = 𝑥𝑥2̇
𝑣𝑣1̇ =_______ 𝑣𝑣 2̇ = _ _ _ _ _ _ _ 𝑣𝑣 3̇ = _ _ _ _ _ _ _ 𝑣𝑣4̇ =_______
𝑣𝑣 5̇ = _ _ _ _ _ _ _ 𝑦𝑦̇ = 𝑣𝑣5̇
𝜕𝜕𝜕𝜕 (2) For calculating 𝜕𝜕𝑥𝑥2
𝑣𝑣̇ =𝑥𝑥̇ −1 1
𝑣𝑣0̇ = 𝑥𝑥2̇
𝑣𝑣1̇ =_______ 𝑣𝑣 2̇ = _ _ _ _ _ _ _ 𝑣𝑣 3̇ = _ _ _ _ _ _ _ 𝑣𝑣4̇ =_______ 𝑣𝑣 5̇ = _ _ _ _ _ _ _ 𝑦𝑦̇ = 𝑣𝑣5̇
Reverse adjoint trace
𝑥𝑥̅2 = 𝑣𝑣̅0
𝑣𝑣̅−1 = _______ 𝑣𝑣̅0 = _______ 𝑣𝑣̅−1 = _______ 𝑣𝑣̅0 = _______ 𝑣𝑣̅2 = _______ 𝑣𝑣 1̅ = _ _ _ _ _ _ _ 𝑣𝑣̅3 = _______ 𝑣𝑣 4̅ = _ _ _ _ _ _ _ 𝑣𝑣 ̅ 5 = 𝑦𝑦�
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com