Back to Annotated Deep Learning Paper Implementations

උදාහරණයක්ලෙස සාමාන්යකරණය සඳහා CIFAR10 අත්හදා බැලීම

docs/si/normalization/instance_norm/experiment.html

latest2.7 KB
Original Source

homenormalizationinstance_norm

View code on Github

#

උදාහරණයක්ලෙස සාමාන්යකරණය සඳහා CIFAR10 අත්හදා බැලීම

වර්ගීකරණයසඳහා සංවහන ස්නායුක ජාලයක උදාහරණයක් සාමාන්යකරණ ස්තරයක් භාවිතා කිරීම මෙයින් පෙන්නුම් කෙරේ. උදාහරණයක් නොවේ සාමාන්යකරණය මෝස්තර මාරු කිරීම සඳහා නිර්මාණය කර ඇති අතර මෙය නිරූපණයක් පමණි.

16importtorch.nnasnn1718fromlabmlimportexperiment19fromlabml.configsimportoption20fromlabml\_nn.experiments.cifar10importCIFAR10Configs,CIFAR10VGGModel21fromlabml\_nn.normalization.instance\_normimportInstanceNorm

#

CIFA-10වර්ගීකරණය සඳහා VGG ආකෘතිය

මෙය සාමාන්ය VGG විලාසිතාවේ ගෘහ නිර්මාණ ශිල්පයෙන්ලබා ගනී.

24classModel(CIFAR10VGGModel):

#

31defconv\_block(self,in\_channels,out\_channels)-\>nn.Module:32returnnn.Sequential(33nn.Conv2d(in\_channels,out\_channels,kernel\_size=3,padding=1),34InstanceNorm(out\_channels),35nn.ReLU(inplace=True),36)

#

38def\_\_init\_\_(self):39super().\_\_init\_\_([[64,64],[128,128],[256,256,256],[512,512,512],[512,512,512]])

#

ආකෘතියසාදන්න

42@option(CIFAR10Configs.model)43def\_model(c:CIFAR10Configs):

#

47returnModel().to(c.device)

#

50defmain():

#

අත්හදාබැලීම සාදන්න

52experiment.create(name='cifar10',comment='instance norm')

#

වින්යාසයන්සාදන්න

54conf=CIFAR10Configs()

#

වින්යාසයන්පූරණය කරන්න

56experiment.configs(conf,{57'optimizer.optimizer':'Adam',58'optimizer.learning\_rate':2.5e-4,59})

#

අත්හදාබැලීම ආරම්භ කර පුහුණු ලූපය ක්රියාත්මක කරන්න

61withexperiment.start():62conf.run()

#

66if\_\_name\_\_=='\_\_main\_\_':67main()

Trending Research Paperslabml.ai