Steganografiya quyidagi sohalarda qo'llaniladi, lekin ular bilan cheklanmaydi



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

item.tobytes(),
hashlib.sha256).hexdigest()
bits = bitstring.BitArray(hex=hashed).bin
if int(bits[:self.args.precision_dawn], 2) <= bound:
return False
else:
return True

def generate_trigger_dawn(self):
"""Generation trigger set based on the paper.

DAWN: Dynamic Adversarial Watermarking of Neural Networks

by Szyller et al.

Returns:
trainloader (Object): training loader
valloader (Object): validation loader
testloader (Object): test loader
triggerloader (Object): trigger loader

"""

trainloader = torch.utils.data.DataLoader(
self.trainset, batch_size=1, shuffle=True)
triggerset = []
for _, data in enumerate(trainloader):
inputs, labels = data
shapes = list(inputs.size())
if not self.__is_prediction_dawn(inputs.numpy()):
triggerset.append((inputs.reshape(shapes[1:]), labels))

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

return None, None, None, triggerloader

def train_step(self, X, Y, idx):
"""Training step

Args:
X (Tensor): input data
Y (Tensor): label data
idx (int): batch id

"""
# Compute loss for original data
inputs, labels = X.to(self.device), Y.to(self.device)
self.optimizer.zero_grad()
outputs = self.model(inputs)
loss = self.args.criterion(outputs, labels)
# Watermark loss if required
if self.watermark:
if idx % self.args.interval_wm == 0:
wmloss = self.watermark_loss()
loss += wmloss

Download 45,83 Kb.

Do'stlaringiz bilan baham:
1   ...   15   16   17   18   19   20   21   22   ...   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