Steganografiya quyidagi sohalarda qo'llaniladi, lekin ular bilan cheklanmaydi



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

loss.backward(retain_graph=True)
self.optimizer.step()

def watermark_loss(self):
"""Compute loss on watermark.

Returns:
wmloss (float): loss on watermark data

"""
wmloss = None
for _, data in enumerate(self.triggerloader):
inputs, labels = data
outputs = self.model(inputs.to(self.device))
if not wmloss:
wmloss = self.args.criterion(outputs, labels.to(self.device))
else:
wmloss += self.args.criterion(outputs, labels.to(self.device))
return wmloss

def get_ownership(self):
"""Compute ownership information

Returns:_ownership_(dict):_information_on_trigger_data__"""_ownership_=_{}_WM_X,_WM_y_=_[],_[]'>Returns:
ownership (dict): information on trigger data

"""
ownership = {}
WM_X, WM_y = [], []
for _, data in enumerate(self.triggerloader):
inputs, labels = data
WM_X += list(inputs.cpu().detach().numpy())
WM_y += list(labels.cpu().detach().numpy())

ownership['inputs'] = WM_X
ownership['labels'] = WM_y
ownership['bounds'] = (min(WM_y), max(WM_y))

return ownership

def train(self):
"""Train the model on watermarked data.

Args:
trainloader (object): training data
epochs (int): number of epochs

Returns:
ownership (dict): Ownership information (None
if model not watermarked)

"""
self.model.to(self.device)
logger.info('Training')
pbar = tqdm.tqdm(range(self.args.epochs),
disable=not self.args.verbose)
for _ in pbar:
for idx, data in enumerate(self.trainloader):
X, y = data
self.train_step(X, y, idx)


Download 45,83 Kb.

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