Steganografiya quyidagi sohalarda qo'llaniladi, lekin ular bilan cheklanmaydi


sampled = torch.utils.data.Subset(



Download 45,83 Kb.
bet18/40
Sana14.04.2022
Hajmi45,83 Kb.
#551350
1   ...   14   15   16   17   18   19   20   21   ...   40
Bog'liq
sregono

sampled = torch.utils.data.Subset(
self.trainset, random.choices(range(len(self.trainset)), k=500))
trainloader = torch.utils.data.DataLoader(
sampled, batch_size=1, shuffle=True)

for data, target in trainloader:

data, target = data.to(self.device), target.to(self.device)
data.requires_grad = True
output = self.model(data)
init_pred = output.max(1, keepdim=True)[1]

# If the initial prediction is wrong, pass
if init_pred.item() != target.item():
continue

# Calculate the loss
loss = self.args.criterion(output, target)
self.model.zero_grad()
loss.backward()
data_grad = data.grad.data

perturbed_data = self.__fgsm_attack(data, epsilon, data_grad)
output = self.model(perturbed_data)

final_pred = output.max(1, keepdim=True)[1]
if final_pred.item() != target.item():
shape = perturbed_data.shape
triggerset.append((perturbed_data.reshape(shape[1:]),
final_pred.item()))

triggerloader = torch.utils.data.DataLoader(
triggerset, batch_size=self.args.batch_size, shuffle=True)

trainloader, valloader, testloader = self.loaders()
return trainloader, valloader, testloader, triggerloader

def __is_prediction_dawn(self, item):
""" Verify if prediction should be
correct as in the DAWN paper.

Args:
item (array): Single query

Returns:
(bool): Should the input be correctly classified ?

"""
bound = floor((2 ** self.args.precision_dawn)
* self.args.probability_dawn)
hashed = hmac.new(
self.args.key_dawn.encode("utf-8"),

Download 45,83 Kb.

Do'stlaringiz bilan baham:
1   ...   14   15   16   17   18   19   20   21   ...   40




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish