Steganografiya quyidagi sohalarda qo'llaniladi, lekin ular bilan cheklanmaydi


if self.criterion == 'cross-entropy'



Download 45,83 Kb.
bet26/40
Sana14.04.2022
Hajmi45,83 Kb.
#551350
1   ...   22   23   24   25   26   27   28   29   ...   40
Bog'liq
sregono

if self.criterion == 'cross-entropy':
self.criterion = nn.CrossEntropyLoss()


import torchvision
from torchvision import transforms


def load_trigger(path, shape):
"""Load trigger data.

Returns:
path (str): trigger images folder
shape (tuple): tuple for dimension of the data

"""
x, y, z = shape
modification = [transforms.Resize((y, z)), transforms.CenterCrop(y)]
# Convert 3 channels to 1
if x == 1:
modification.append(transforms.Grayscale(num_output_channels=1))
modification.append(transforms.ToTensor())
else:
modification.append(transforms.ToTensor())
transformation = torchvision.transforms.Compose(modification)
specialset = torchvision.datasets.ImageFolder(path,
transform=transformation)
return specialset


from math import floor, sqrt

from scipy.special import comb


def threshold_classifier(trigger_size, number_labels, error_rate=0.001):
"""Compute threshold for classification task.

Args:
trigger_size (int): Number of trigger instances
number_labels (int): Number of labels
error_rate (int): Error rate of verification

Returns:
threshold (float): The minimal threshold

"""
# Define parameters
threshold = 1 / number_labels
precision = 1 / trigger_size
S = 0

# Compute confidence level

for i in range(0, int(threshold * trigger_size) + 1):
wrong_detected = ((1 - 1 / number_labels)**(trigger_size - i))
S += comb(trigger_size, i) * (1 / (number_labels**i)) * wrong_detected

Download 45,83 Kb.

Do'stlaringiz bilan baham:
1   ...   22   23   24   25   26   27   28   29   ...   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