Steganografiya quyidagi sohalarda qo'llaniladi, lekin ular bilan cheklanmaydi


mode (str, optional): Classification or



Download 45,83 Kb.
bet8/40
Sana14.04.2022
Hajmi45,83 Kb.
#551350
1   ...   4   5   6   7   8   9   10   11   ...   40
Bog'liq
sregono

mode (str, optional): Classification or
regression mode

Returns:
ownership (dict): Watermark triggers information
X_train (array): Modified input data
y_train (array): Modified label data

"""
# Check if inputs are arrays
if type(X_train) != np.ndarray and type(y_train) != np.ndarray:
raise TypeError("Error: X and Y must be np.ndarray!")

WM_X, WM_y = np.array([]), np.array([])
ownership = {}
_, shape_x = X_train.shape

for k in range(self.trigger_size):
# Generate triggers
trigger_x = np.array([[random.random() for i in range(shape_x)]])
if mode == 'CLASSIFICATION':
trigger_y = np.array([random.choice(np.unique(y_train))])
else:
a, b = min(y_train), max(y_train)
trigger_y = np.array([random.randint(a, b)])
# Add instance to trigger set
if k == 0:
WM_X, WM_y = trigger_x, trigger_y
else:
WM_X = np.vstack((WM_X, trigger_x))
WM_y = np.vstack((WM_y, trigger_y))

# Add trigger to training data
X_train = np.vstack((X_train, WM_X))
y_train = np.vstack((y_train.reshape(-1, 1), WM_y)).ravel()
ownership['inputs'] = WM_X
ownership['labels'] = WM_y.ravel()
ownership['bounds'] = (min(y_train), max(y_train))

return ownership, X_train, y_train

def train_step(self, ownership, X_train, y_train):
"""Train the model depending on model type.

Args:
ownership (dict): Ownership information about
triggers
X_train (array): Input data
y_train (array): Label data (0 / 1)

Returns:
None for classification tasks

Download 45,83 Kb.

Do'stlaringiz bilan baham:
1   ...   4   5   6   7   8   9   10   11   ...   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