Steganografiya quyidagi sohalarda qo'llaniladi, lekin ular bilan cheklanmaydi



Download 45,83 Kb.
bet13/40
Sana14.04.2022
Hajmi45,83 Kb.
#551350
1   ...   9   10   11   12   13   14   15   16   ...   40
Bog'liq
sregono

import torch.nn as nn
import torch.optim as optim
import tqdm
from cryptography.fernet import Fernet
from torch.utils.data import DataLoader

from mlmodelwatermarking.loggers.logger import logger
from mlmodelwatermarking.verification import verify

warnings.filterwarnings('ignore')


class Trainer:
def __init__(
self,
model,
args,
trainset=None,
valset=None,
testset=None,
specialset=None):

""" Main wrapper class to watermark Pytorch models.

Args:
model (Object): model to be trained and watermarked
trainset (Object): training dataset
valset (Object): validation dataset
testset (Object): test dataset
specialset (Object, optional): trigger set for 'selected'

args (dict): args for watermarking

"""

# Non optional
self.model = model
self.trainset = trainset
self.args = args
self.valset = valset
self.testset = testset
self.specialset = specialset

self.watermark = args.watermark

if args.optimizer == 'SGD':
self.optimizer = optim.SGD(self.model.parameters(), lr=args.lr)
self.patch_args = args.trigger_patch_args

if args.gpu:
available = torch.cuda.is_available()
self.device = torch.device('cuda' if available else 'cpu')
else:
self.device = 'cpu'
if self.args.verbose is False:
logger.disable()
if self.watermark:
logger.info('Generation of the trigers')
loaders = self.generate_trigger()
(self.trainloader, self.valloader,

Download 45,83 Kb.

Do'stlaringiz bilan baham:
1   ...   9   10   11   12   13   14   15   16   ...   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