In Masterarbeit:"Anomalie-Detektion in Zellbildern zur Anwendung der Leukämieerkennung" verwendete CSI Methode.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

train.ipynb 90KB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": null,
  6. "id": "c812e9f6",
  7. "metadata": {},
  8. "outputs": [],
  9. "source": [
  10. "#!pip3 install --upgrade pip setuptools wheel"
  11. ]
  12. },
  13. {
  14. "cell_type": "code",
  15. "execution_count": 18,
  16. "id": "3c2f5cb0",
  17. "metadata": {},
  18. "outputs": [],
  19. "source": [
  20. "!chmod +x eval.py"
  21. ]
  22. },
  23. {
  24. "cell_type": "code",
  25. "execution_count": null,
  26. "id": "9808149e",
  27. "metadata": {},
  28. "outputs": [],
  29. "source": [
  30. "#setup\n",
  31. "!git clone https://github.com/NVIDIA/apex\n",
  32. "!cp /home/feoktistovar67431/git/apex/setup.py .\n",
  33. "!pip3 install -v --disable-pip-version-check --no-cache-dir ./\n",
  34. "!pip install git+https://github.com/ildoonet/pytorch-gradual-warmup-lr.git\n",
  35. "!python3 -m pip install torch torchvision scikit-learn tensorboard diffdist==0.1 tensorboardX torchlars==0.1.2 apex"
  36. ]
  37. },
  38. {
  39. "cell_type": "code",
  40. "execution_count": null,
  41. "id": "bf0756e3",
  42. "metadata": {},
  43. "outputs": [],
  44. "source": [
  45. "import torch\n",
  46. "\n",
  47. "print(f\"Is CUDA supported by this system? ->{torch.cuda.is_available()}\")\n",
  48. "print(f\"CUDA version: {torch.version.cuda}\")\n",
  49. "cuda_id = torch.cuda.current_device()\n",
  50. "print(f\"ID of current CUDA device: {torch.cuda.current_device()}\")\n",
  51. "print(f\"Number of available devices: {torch.cuda.device_count()}\\n\")"
  52. ]
  53. },
  54. {
  55. "cell_type": "code",
  56. "execution_count": null,
  57. "id": "5f7ff35c",
  58. "metadata": {
  59. "scrolled": true
  60. },
  61. "outputs": [],
  62. "source": [
  63. "#TEST ONLY\n",
  64. "#!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 '/home/feoktistovar67431/CSI/CSI/train.py' --dataset 'cifar10' --model 'resnet18' --mode simclr_CSI --shift_trans_type rotation --epochs 10 --batch_size 32 --optimizer sgd --one_class_idx 9"
  65. ]
  66. },
  67. {
  68. "cell_type": "markdown",
  69. "id": "e3f0081b",
  70. "metadata": {},
  71. "source": [
  72. "# Combined shiftings"
  73. ]
  74. },
  75. {
  76. "cell_type": "code",
  77. "execution_count": 222,
  78. "id": "26921f38",
  79. "metadata": {},
  80. "outputs": [
  81. {
  82. "name": "stdout",
  83. "output_type": "stream",
  84. "text": [
  85. "/home/feoktistovar67431/.local/lib/python3.6/site-packages/torch/distributed/launch.py:186: FutureWarning: The module torch.distributed.launch is deprecated\n",
  86. "and will be removed in future. Use torchrun.\n",
  87. "Note that --use_env is set by default in torchrun.\n",
  88. "If your script expects `--local_rank` argument to be set, please\n",
  89. "change it to read from `os.environ['LOCAL_RANK']` instead. See \n",
  90. "https://pytorch.org/docs/stable/distributed.html#launch-utility for \n",
  91. "further instructions\n",
  92. "\n",
  93. " FutureWarning,\n",
  94. "WARNING:torch.distributed.run:\n",
  95. "*****************************************\n",
  96. "Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. \n",
  97. "*****************************************\n",
  98. "Warning: using Python fallback for SyncBatchNorm, possibly because apex was installed without --cuda_ext. The exception raised when attempting to import the cuda backend was: No module named 'syncbn'\n",
  99. "Warning: using Python fallback for SyncBatchNorm, possibly because apex was installed without --cuda_ext. The exception raised when attempting to import the cuda backend was: No module named 'syncbn'\n",
  100. "Warning: apex was installed without --cpp_ext. Falling back to Python flatten and unflatten.\n",
  101. "Warning: apex was installed without --cpp_ext. Falling back to Python flatten and unflatten.\n",
  102. "[2022-04-27 21:19:03.912343] Namespace(K_shift=4, batch_size=8, blur_sigma=40.0, color_distort=0.5, dataset='CNMC', distortion_scale=0.8, epochs=10, error_step=5, image_size=(300, 300, 3), load_path=None, local_rank=0, lr_init=0.1, lr_scheduler='cosine', mode='simclr_CSI', model='resnet18_imagenet', multi_gpu=True, n_classes=2, n_gpus=2, n_superclasses=2, no_strict=False, noise_mean=0, noise_std=0.3, one_class_idx=1, ood_batch_size=100, ood_dataset=[0], ood_layer='simclr', ood_samples=1, ood_score=['norm_mean'], optimizer='sgd', print_score=False, proc_step=None, res='450px', resize_factor=0.08, resize_fix=False, resume_path=None, save_score=False, save_step=10, sharpness_factor=2, shift_trans=BlurRandpers(\n",
  103. " (gauss): GaussBlur()\n",
  104. " (randpers): RandPers()\n",
  105. "), shift_trans_type='blur_randpers', sim_lambda=1.0, simclr_dim=128, suffix=None, temperature=0.5, test_batch_size=100, warmup=10, weight_decay=1e-06)\n",
  106. "[2022-04-27 21:19:03.912780] DistributedDataParallel(\n",
  107. " (module): ResNet(\n",
  108. " (linear): Linear(in_features=512, out_features=2, bias=True)\n",
  109. " (simclr_layer): Sequential(\n",
  110. " (0): Linear(in_features=512, out_features=512, bias=True)\n",
  111. " (1): ReLU()\n",
  112. " (2): Linear(in_features=512, out_features=128, bias=True)\n",
  113. " )\n",
  114. " (shift_cls_layer): Linear(in_features=512, out_features=4, bias=True)\n",
  115. " (joint_distribution_layer): Linear(in_features=512, out_features=8, bias=True)\n",
  116. " (conv1): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)\n",
  117. " (bn1): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  118. " (relu): ReLU(inplace=True)\n",
  119. " (maxpool): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
  120. " (layer1): Sequential(\n",
  121. " (0): BasicBlock(\n",
  122. " (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  123. " (bn1): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  124. " (relu): ReLU(inplace=True)\n",
  125. " (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  126. " (bn2): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  127. " )\n",
  128. " (1): BasicBlock(\n",
  129. " (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  130. " (bn1): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  131. " (relu): ReLU(inplace=True)\n",
  132. " (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  133. " (bn2): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  134. " )\n",
  135. " )\n",
  136. " (layer2): Sequential(\n",
  137. " (0): BasicBlock(\n",
  138. " (conv1): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)\n",
  139. " (bn1): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  140. " (relu): ReLU(inplace=True)\n",
  141. " (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  142. " (bn2): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  143. " (downsample): Sequential(\n",
  144. " (0): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
  145. " (1): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  146. " )\n",
  147. " )\n",
  148. " (1): BasicBlock(\n",
  149. " (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  150. " (bn1): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  151. " (relu): ReLU(inplace=True)\n",
  152. " (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  153. " (bn2): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  154. " )\n",
  155. " )\n",
  156. " (layer3): Sequential(\n",
  157. " (0): BasicBlock(\n",
  158. " (conv1): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)\n",
  159. " (bn1): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  160. " (relu): ReLU(inplace=True)\n",
  161. " (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  162. " (bn2): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  163. " (downsample): Sequential(\n",
  164. " (0): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
  165. " (1): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  166. " )\n",
  167. " )\n",
  168. " (1): BasicBlock(\n",
  169. " (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  170. " (bn1): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  171. " (relu): ReLU(inplace=True)\n",
  172. " (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  173. " (bn2): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  174. " )\n",
  175. " )\n",
  176. " (layer4): Sequential(\n",
  177. " (0): BasicBlock(\n",
  178. " (conv1): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)\n",
  179. " (bn1): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  180. " (relu): ReLU(inplace=True)\n",
  181. " (conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  182. " (bn2): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  183. " (downsample): Sequential(\n",
  184. " (0): Conv2d(256, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
  185. " (1): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  186. " )\n",
  187. " )\n",
  188. " (1): BasicBlock(\n",
  189. " (conv1): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  190. " (bn1): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  191. " (relu): ReLU(inplace=True)\n",
  192. " (conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  193. " (bn2): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  194. " )\n",
  195. " )\n",
  196. " (avgpool): AdaptiveAvgPool2d(output_size=(1, 1))\n",
  197. " (normalize): NormalizeLayer()\n",
  198. " )\n",
  199. ")\n",
  200. "Epoch 1 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  201. "/home/feoktistovar67431/.local/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:154: UserWarning: The epoch parameter in `scheduler.step()` was not necessary and is being deprecated where possible. Please use `scheduler.step()` to step the scheduler. During the deprecation, if epoch is different from None, the closed form is used instead of the new chainable form, where available. Please open an issue if you are unable to replicate your use case: https://github.com/pytorch/pytorch/issues/new/choose.\n",
  202. " warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)\n",
  203. "/home/feoktistovar67431/.local/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:154: UserWarning: The epoch parameter in `scheduler.step()` was not necessary and is being deprecated where possible. Please use `scheduler.step()` to step the scheduler. During the deprecation, if epoch is different from None, the closed form is used instead of the new chainable form, where available. Please open an issue if you are unable to replicate your use case: https://github.com/pytorch/pytorch/issues/new/choose.\n",
  204. " warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)\n"
  205. ]
  206. },
  207. {
  208. "name": "stdout",
  209. "output_type": "stream",
  210. "text": [
  211. "[2022-04-27 21:19:06.681133] [Epoch 1; 0] [Time 1.753] [Data 0.128] [LR 0.10000]\n",
  212. "[LossC 0.000000] [LossSim 4.795710] [LossShift 1.446792]\n",
  213. "[2022-04-27 21:19:26.588634] [Epoch 1; 50] [Time 0.435] [Data 0.827] [LR 0.11004]\n",
  214. "[LossC 0.000000] [LossSim 4.458384] [LossShift 1.450558]\n",
  215. "[2022-04-27 21:19:47.065503] [Epoch 1; 100] [Time 0.441] [Data 0.818] [LR 0.12009]\n",
  216. "[LossC 0.000000] [LossSim 4.495318] [LossShift 0.887940]\n",
  217. "[2022-04-27 21:20:08.001796] [Epoch 1; 150] [Time 0.451] [Data 0.826] [LR 0.13013]\n",
  218. "[LossC 0.000000] [LossSim 4.466498] [LossShift 1.651758]\n",
  219. "[2022-04-27 21:20:29.557696] [Epoch 1; 200] [Time 0.463] [Data 0.859] [LR 0.14018]\n",
  220. "[LossC 0.000000] [LossSim 4.488340] [LossShift 0.890679]\n",
  221. "[2022-04-27 21:20:51.522911] [Epoch 1; 250] [Time 0.465] [Data 0.987] [LR 0.15022]\n",
  222. "[LossC 0.000000] [LossSim 4.457443] [LossShift 1.463503]\n",
  223. "[2022-04-27 21:21:13.774301] [Epoch 1; 300] [Time 0.481] [Data 0.873] [LR 0.16027]\n",
  224. "[LossC 0.000000] [LossSim 4.408203] [LossShift 0.978724]\n",
  225. "[2022-04-27 21:21:36.139558] [Epoch 1; 350] [Time 0.463] [Data 0.896] [LR 0.17031]\n",
  226. "[LossC 0.000000] [LossSim 4.406531] [LossShift 0.853714]\n",
  227. "[2022-04-27 21:21:58.598135] [Epoch 1; 400] [Time 0.469] [Data 0.870] [LR 0.18036]\n",
  228. "[LossC 0.000000] [LossSim 4.494049] [LossShift 0.970959]\n",
  229. "[2022-04-27 21:22:19.114742] [DONE] [Time 0.471] [Data 0.868] [LossC 0.000000] [LossSim 4.517576] [LossShift 1.226323]\n",
  230. "Epoch 2 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  231. "[2022-04-27 21:22:20.199138] [Epoch 2; 0] [Time 0.502] [Data 0.158] [LR 0.19000]\n",
  232. "[LossC 0.000000] [LossSim 4.359697] [LossShift 0.896302]\n",
  233. "[2022-04-27 21:22:42.722677] [Epoch 2; 50] [Time 0.452] [Data 0.869] [LR 0.20004]\n",
  234. "[LossC 0.000000] [LossSim 4.424041] [LossShift 0.848778]\n",
  235. "[2022-04-27 21:23:05.591518] [Epoch 2; 100] [Time 0.452] [Data 0.867] [LR 0.21009]\n",
  236. "[LossC 0.000000] [LossSim 4.309733] [LossShift 0.864205]\n",
  237. "[2022-04-27 21:23:28.092864] [Epoch 2; 150] [Time 0.471] [Data 0.871] [LR 0.22013]\n",
  238. "[LossC 0.000000] [LossSim 4.339020] [LossShift 0.861768]\n",
  239. "[2022-04-27 21:23:51.151448] [Epoch 2; 200] [Time 0.471] [Data 0.982] [LR 0.23018]\n",
  240. "[LossC 0.000000] [LossSim 4.398156] [LossShift 0.844045]\n",
  241. "[2022-04-27 21:24:13.759556] [Epoch 2; 250] [Time 0.474] [Data 0.873] [LR 0.24022]\n",
  242. "[LossC 0.000000] [LossSim 4.331997] [LossShift 0.895239]\n",
  243. "[2022-04-27 21:24:36.498251] [Epoch 2; 300] [Time 0.557] [Data 0.844] [LR 0.25027]\n",
  244. "[LossC 0.000000] [LossSim 4.314375] [LossShift 0.844688]\n",
  245. "[2022-04-27 21:24:59.086448] [Epoch 2; 350] [Time 0.448] [Data 0.855] [LR 0.26031]\n",
  246. "[LossC 0.000000] [LossSim 4.494950] [LossShift 0.842451]\n",
  247. "[2022-04-27 21:25:22.358179] [Epoch 2; 400] [Time 0.509] [Data 0.884] [LR 0.27036]\n",
  248. "[LossC 0.000000] [LossSim 4.366556] [LossShift 0.884501]\n",
  249. "[2022-04-27 21:25:43.075378] [DONE] [Time 0.487] [Data 0.907] [LossC 0.000000] [LossSim 4.395404] [LossShift 0.913691]\n",
  250. "Epoch 3 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  251. "[2022-04-27 21:25:44.090938] [Epoch 3; 0] [Time 0.461] [Data 0.134] [LR 0.28000]\n",
  252. "[LossC 0.000000] [LossSim 4.363524] [LossShift 0.843010]\n",
  253. "[2022-04-27 21:26:06.906782] [Epoch 3; 50] [Time 0.489] [Data 0.855] [LR 0.29004]\n",
  254. "[LossC 0.000000] [LossSim 4.475645] [LossShift 1.142160]\n",
  255. "[2022-04-27 21:26:30.509720] [Epoch 3; 100] [Time 0.454] [Data 0.893] [LR 0.30009]\n",
  256. "[LossC 0.000000] [LossSim 4.336016] [LossShift 0.952089]\n",
  257. "[2022-04-27 21:26:53.002780] [Epoch 3; 150] [Time 0.477] [Data 0.860] [LR 0.31013]\n",
  258. "[LossC 0.000000] [LossSim 4.475717] [LossShift 0.875115]\n",
  259. "[2022-04-27 21:27:15.597338] [Epoch 3; 200] [Time 0.471] [Data 0.857] [LR 0.32018]\n",
  260. "[LossC 0.000000] [LossSim 4.349196] [LossShift 0.872518]\n",
  261. "[2022-04-27 21:27:38.345896] [Epoch 3; 250] [Time 0.463] [Data 0.877] [LR 0.33022]\n",
  262. "[LossC 0.000000] [LossSim 4.353239] [LossShift 0.881434]\n",
  263. "[2022-04-27 21:28:01.311768] [Epoch 3; 300] [Time 0.476] [Data 0.876] [LR 0.34027]\n",
  264. "[LossC 0.000000] [LossSim 4.418363] [LossShift 0.876285]\n",
  265. "[2022-04-27 21:28:24.109063] [Epoch 3; 350] [Time 0.529] [Data 0.860] [LR 0.35031]\n",
  266. "[LossC 0.000000] [LossSim 4.391089] [LossShift 0.891998]\n",
  267. "[2022-04-27 21:28:46.767573] [Epoch 3; 400] [Time 0.490] [Data 0.923] [LR 0.36036]\n",
  268. "[LossC 0.000000] [LossSim 4.366334] [LossShift 0.961224]\n",
  269. "[2022-04-27 21:29:07.659288] [DONE] [Time 0.485] [Data 0.909] [LossC 0.000000] [LossSim 4.379301] [LossShift 0.903935]\n",
  270. "Epoch 4 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  271. "[2022-04-27 21:29:08.649924] [Epoch 4; 0] [Time 0.441] [Data 0.154] [LR 0.37000]\n",
  272. "[LossC 0.000000] [LossSim 4.468335] [LossShift 0.975977]\n",
  273. "[2022-04-27 21:29:31.468727] [Epoch 4; 50] [Time 0.459] [Data 0.911] [LR 0.38004]\n",
  274. "[LossC 0.000000] [LossSim 4.803634] [LossShift 2.258877]\n",
  275. "[2022-04-27 21:29:53.609175] [Epoch 4; 100] [Time 0.471] [Data 0.855] [LR 0.39009]\n",
  276. "[LossC 0.000000] [LossSim 4.457827] [LossShift 0.855588]\n",
  277. "[2022-04-27 21:30:16.236645] [Epoch 4; 150] [Time 0.472] [Data 0.861] [LR 0.40013]\n",
  278. "[LossC 0.000000] [LossSim 4.359911] [LossShift 0.869267]\n",
  279. "[2022-04-27 21:30:38.965445] [Epoch 4; 200] [Time 0.457] [Data 0.922] [LR 0.41018]\n",
  280. "[LossC 0.000000] [LossSim 4.300039] [LossShift 0.853143]\n",
  281. "[2022-04-27 21:31:01.744464] [Epoch 4; 250] [Time 0.464] [Data 0.847] [LR 0.42022]\n",
  282. "[LossC 0.000000] [LossSim 4.343868] [LossShift 0.904560]\n",
  283. "[2022-04-27 21:31:24.138632] [Epoch 4; 300] [Time 0.468] [Data 0.929] [LR 0.43027]\n",
  284. "[LossC 0.000000] [LossSim 4.440177] [LossShift 1.008291]\n",
  285. "[2022-04-27 21:31:47.197617] [Epoch 4; 350] [Time 0.459] [Data 0.988] [LR 0.44031]\n",
  286. "[LossC 0.000000] [LossSim 4.313808] [LossShift 0.843529]\n",
  287. "[2022-04-27 21:32:10.020673] [Epoch 4; 400] [Time 0.464] [Data 0.915] [LR 0.45036]\n",
  288. "[LossC 0.000000] [LossSim 4.347077] [LossShift 0.842586]\n",
  289. "[2022-04-27 21:32:30.667648] [DONE] [Time 0.484] [Data 0.903] [LossC 0.000000] [LossSim 4.378773] [LossShift 0.932685]\n",
  290. "Epoch 5 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  291. "[2022-04-27 21:32:31.676676] [Epoch 5; 0] [Time 0.472] [Data 0.141] [LR 0.46000]\n",
  292. "[LossC 0.000000] [LossSim 4.296750] [LossShift 0.850581]\n",
  293. "[2022-04-27 21:32:54.231546] [Epoch 5; 50] [Time 0.531] [Data 0.852] [LR 0.47004]\n",
  294. "[LossC 0.000000] [LossSim 4.324140] [LossShift 0.856480]\n",
  295. "[2022-04-27 21:33:16.815921] [Epoch 5; 100] [Time 0.554] [Data 0.887] [LR 0.48009]\n",
  296. "[LossC 0.000000] [LossSim 4.298337] [LossShift 0.911719]\n",
  297. "[2022-04-27 21:33:39.742560] [Epoch 5; 150] [Time 0.513] [Data 0.938] [LR 0.49013]\n",
  298. "[LossC 0.000000] [LossSim 4.311210] [LossShift 0.854077]\n",
  299. "[2022-04-27 21:34:02.227222] [Epoch 5; 200] [Time 0.544] [Data 0.883] [LR 0.50018]\n",
  300. "[LossC 0.000000] [LossSim 4.316729] [LossShift 0.873590]\n",
  301. "[2022-04-27 21:34:25.029707] [Epoch 5; 250] [Time 0.595] [Data 0.907] [LR 0.51022]\n",
  302. "[LossC 0.000000] [LossSim 4.332903] [LossShift 0.852887]\n",
  303. "[2022-04-27 21:34:47.734705] [Epoch 5; 300] [Time 0.457] [Data 0.884] [LR 0.52027]\n",
  304. "[LossC 0.000000] [LossSim 4.326703] [LossShift 0.827790]\n",
  305. "[2022-04-27 21:35:10.065878] [Epoch 5; 350] [Time 0.480] [Data 0.848] [LR 0.53031]\n",
  306. "[LossC 0.000000] [LossSim 4.629390] [LossShift 0.972859]\n",
  307. "[2022-04-27 21:35:32.496680] [Epoch 5; 400] [Time 0.471] [Data 0.945] [LR 0.54036]\n",
  308. "[LossC 0.000000] [LossSim 4.476654] [LossShift 0.924936]\n",
  309. "[2022-04-27 21:35:53.353584] [DONE] [Time 0.484] [Data 0.901] [LossC 0.000000] [LossSim 4.361738] [LossShift 0.904301]\n",
  310. "Epoch 6 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  311. "[2022-04-27 21:35:54.394370] [Epoch 6; 0] [Time 0.459] [Data 0.168] [LR 0.55000]\n",
  312. "[LossC 0.000000] [LossSim 4.356859] [LossShift 0.916392]\n",
  313. "[2022-04-27 21:36:16.884891] [Epoch 6; 50] [Time 0.461] [Data 0.861] [LR 0.56004]\n",
  314. "[LossC 0.000000] [LossSim 4.396854] [LossShift 0.942714]\n",
  315. "[2022-04-27 21:36:39.738454] [Epoch 6; 100] [Time 0.460] [Data 0.898] [LR 0.57009]\n",
  316. "[LossC 0.000000] [LossSim 4.463193] [LossShift 0.884684]\n",
  317. "[2022-04-27 21:37:02.620539] [Epoch 6; 150] [Time 0.467] [Data 0.885] [LR 0.58013]\n",
  318. "[LossC 0.000000] [LossSim 4.373494] [LossShift 0.972907]\n",
  319. "[2022-04-27 21:37:26.181037] [Epoch 6; 200] [Time 0.469] [Data 0.986] [LR 0.59018]\n",
  320. "[LossC 0.000000] [LossSim 4.492169] [LossShift 0.874383]\n"
  321. ]
  322. },
  323. {
  324. "name": "stdout",
  325. "output_type": "stream",
  326. "text": [
  327. "[2022-04-27 21:37:48.941984] [Epoch 6; 250] [Time 0.455] [Data 0.864] [LR 0.60022]\n",
  328. "[LossC 0.000000] [LossSim 4.365623] [LossShift 0.879145]\n",
  329. "[2022-04-27 21:38:11.891998] [Epoch 6; 300] [Time 0.472] [Data 1.195] [LR 0.61027]\n",
  330. "[LossC 0.000000] [LossSim 4.348284] [LossShift 1.021375]\n",
  331. "[2022-04-27 21:38:34.705143] [Epoch 6; 350] [Time 0.536] [Data 0.864] [LR 0.62031]\n",
  332. "[LossC 0.000000] [LossSim 4.290128] [LossShift 0.857135]\n",
  333. "[2022-04-27 21:38:57.461264] [Epoch 6; 400] [Time 0.467] [Data 0.956] [LR 0.63036]\n",
  334. "[LossC 0.000000] [LossSim 4.288968] [LossShift 0.835112]\n",
  335. "[2022-04-27 21:39:18.226831] [DONE] [Time 0.491] [Data 0.911] [LossC 0.000000] [LossSim 4.369289] [LossShift 0.965370]\n",
  336. "Epoch 7 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  337. "[2022-04-27 21:39:19.197901] [Epoch 7; 0] [Time 0.448] [Data 0.145] [LR 0.64000]\n",
  338. "[LossC 0.000000] [LossSim 4.337277] [LossShift 0.845977]\n",
  339. "[2022-04-27 21:39:41.903147] [Epoch 7; 50] [Time 0.516] [Data 0.844] [LR 0.65004]\n",
  340. "[LossC 0.000000] [LossSim 4.348597] [LossShift 0.887782]\n",
  341. "[2022-04-27 21:40:04.761686] [Epoch 7; 100] [Time 0.462] [Data 0.904] [LR 0.66009]\n",
  342. "[LossC 0.000000] [LossSim 4.288217] [LossShift 0.847829]\n",
  343. "[2022-04-27 21:40:27.497629] [Epoch 7; 150] [Time 0.505] [Data 0.909] [LR 0.67013]\n",
  344. "[LossC 0.000000] [LossSim 4.574395] [LossShift 0.856589]\n",
  345. "[2022-04-27 21:40:50.169432] [Epoch 7; 200] [Time 0.503] [Data 0.874] [LR 0.68018]\n",
  346. "[LossC 0.000000] [LossSim 4.347064] [LossShift 1.008280]\n",
  347. "[2022-04-27 21:41:13.461267] [Epoch 7; 250] [Time 0.535] [Data 0.876] [LR 0.69022]\n",
  348. "[LossC 0.000000] [LossSim 4.344507] [LossShift 0.942077]\n",
  349. "[2022-04-27 21:41:36.295103] [Epoch 7; 300] [Time 0.481] [Data 0.856] [LR 0.70027]\n",
  350. "[LossC 0.000000] [LossSim 4.309855] [LossShift 0.832647]\n",
  351. "[2022-04-27 21:41:58.827571] [Epoch 7; 350] [Time 0.464] [Data 0.853] [LR 0.71031]\n",
  352. "[LossC 0.000000] [LossSim 4.432234] [LossShift 1.124480]\n",
  353. "[2022-04-27 21:42:21.525643] [Epoch 7; 400] [Time 0.462] [Data 0.971] [LR 0.72036]\n",
  354. "[LossC 0.000000] [LossSim 4.344445] [LossShift 0.938462]\n",
  355. "[2022-04-27 21:42:42.184827] [DONE] [Time 0.488] [Data 0.907] [LossC 0.000000] [LossSim 4.358003] [LossShift 0.918527]\n",
  356. "Epoch 8 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  357. "[2022-04-27 21:42:43.188401] [Epoch 8; 0] [Time 0.472] [Data 0.151] [LR 0.73000]\n",
  358. "[LossC 0.000000] [LossSim 4.423952] [LossShift 0.940491]\n",
  359. "[2022-04-27 21:43:05.626867] [Epoch 8; 50] [Time 0.609] [Data 0.911] [LR 0.74004]\n",
  360. "[LossC 0.000000] [LossSim 4.442121] [LossShift 0.870375]\n",
  361. "[2022-04-27 21:43:28.441870] [Epoch 8; 100] [Time 0.480] [Data 0.858] [LR 0.75009]\n",
  362. "[LossC 0.000000] [LossSim 4.287797] [LossShift 0.879039]\n",
  363. "[2022-04-27 21:43:51.203855] [Epoch 8; 150] [Time 0.464] [Data 1.064] [LR 0.76013]\n",
  364. "[LossC 0.000000] [LossSim 4.277451] [LossShift 0.845034]\n",
  365. "[2022-04-27 21:44:13.634754] [Epoch 8; 200] [Time 0.568] [Data 0.851] [LR 0.77018]\n",
  366. "[LossC 0.000000] [LossSim 4.329644] [LossShift 0.961596]\n",
  367. "[2022-04-27 21:44:36.887687] [Epoch 8; 250] [Time 0.723] [Data 0.942] [LR 0.78022]\n",
  368. "[LossC 0.000000] [LossSim 4.317680] [LossShift 0.864846]\n",
  369. "[2022-04-27 21:44:59.265520] [Epoch 8; 300] [Time 0.450] [Data 0.856] [LR 0.79027]\n",
  370. "[LossC 0.000000] [LossSim 4.362687] [LossShift 0.917989]\n",
  371. "[2022-04-27 21:45:22.337561] [Epoch 8; 350] [Time 0.480] [Data 0.891] [LR 0.80031]\n",
  372. "[LossC 0.000000] [LossSim 4.263648] [LossShift 0.859828]\n",
  373. "[2022-04-27 21:45:45.275990] [Epoch 8; 400] [Time 0.497] [Data 0.868] [LR 0.81036]\n",
  374. "[LossC 0.000000] [LossSim 4.380607] [LossShift 0.836404]\n",
  375. "[2022-04-27 21:46:06.499931] [DONE] [Time 0.488] [Data 0.908] [LossC 0.000000] [LossSim 4.348544] [LossShift 0.891716]\n",
  376. "Epoch 9 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  377. "[2022-04-27 21:46:07.537821] [Epoch 9; 0] [Time 0.464] [Data 0.159] [LR 0.82000]\n",
  378. "[LossC 0.000000] [LossSim 4.373352] [LossShift 0.876816]\n",
  379. "[2022-04-27 21:46:30.396968] [Epoch 9; 50] [Time 0.455] [Data 0.856] [LR 0.83004]\n",
  380. "[LossC 0.000000] [LossSim 4.306937] [LossShift 0.909936]\n",
  381. "[2022-04-27 21:46:53.286257] [Epoch 9; 100] [Time 0.451] [Data 0.855] [LR 0.84009]\n",
  382. "[LossC 0.000000] [LossSim 4.355694] [LossShift 1.014931]\n",
  383. "[2022-04-27 21:47:16.173773] [Epoch 9; 150] [Time 0.465] [Data 1.050] [LR 0.85013]\n",
  384. "[LossC 0.000000] [LossSim 4.293055] [LossShift 0.837927]\n",
  385. "[2022-04-27 21:47:38.465545] [Epoch 9; 200] [Time 0.465] [Data 0.872] [LR 0.86018]\n",
  386. "[LossC 0.000000] [LossSim 4.365509] [LossShift 0.908220]\n",
  387. "[2022-04-27 21:48:01.092709] [Epoch 9; 250] [Time 0.461] [Data 0.937] [LR 0.87022]\n",
  388. "[LossC 0.000000] [LossSim 4.350402] [LossShift 0.842791]\n",
  389. "[2022-04-27 21:48:24.019747] [Epoch 9; 300] [Time 0.472] [Data 0.906] [LR 0.88027]\n",
  390. "[LossC 0.000000] [LossSim 4.499863] [LossShift 1.153011]\n",
  391. "[2022-04-27 21:48:46.872260] [Epoch 9; 350] [Time 0.477] [Data 0.890] [LR 0.89031]\n",
  392. "[LossC 0.000000] [LossSim 4.301045] [LossShift 0.840660]\n",
  393. "[2022-04-27 21:49:09.507846] [Epoch 9; 400] [Time 0.447] [Data 0.851] [LR 0.90036]\n",
  394. "[LossC 0.000000] [LossSim 4.358407] [LossShift 0.889107]\n",
  395. "[2022-04-27 21:49:30.079116] [DONE] [Time 0.485] [Data 0.905] [LossC 0.000000] [LossSim 4.353526] [LossShift 0.893255]\n",
  396. "Epoch 10 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_randpers_resize_factor0.08_color_dist0.5_one_class_1)\n",
  397. "[2022-04-27 21:49:31.077872] [Epoch 10; 0] [Time 0.455] [Data 0.157] [LR 0.91000]\n",
  398. "[LossC 0.000000] [LossSim 4.342908] [LossShift 0.914479]\n",
  399. "[2022-04-27 21:49:53.899316] [Epoch 10; 50] [Time 0.466] [Data 0.991] [LR 0.92004]\n",
  400. "[LossC 0.000000] [LossSim 4.321300] [LossShift 0.815638]\n",
  401. "[2022-04-27 21:50:16.668189] [Epoch 10; 100] [Time 0.497] [Data 0.877] [LR 0.93009]\n",
  402. "[LossC 0.000000] [LossSim 4.261489] [LossShift 0.859249]\n",
  403. "[2022-04-27 21:50:39.620289] [Epoch 10; 150] [Time 0.585] [Data 0.871] [LR 0.94013]\n",
  404. "[LossC 0.000000] [LossSim 4.288896] [LossShift 0.847932]\n",
  405. "[2022-04-27 21:51:02.703581] [Epoch 10; 200] [Time 0.472] [Data 0.893] [LR 0.95018]\n",
  406. "[LossC 0.000000] [LossSim 4.321000] [LossShift 0.911242]\n",
  407. "[2022-04-27 21:51:25.530056] [Epoch 10; 250] [Time 0.460] [Data 0.888] [LR 0.96022]\n",
  408. "[LossC 0.000000] [LossSim 4.281656] [LossShift 0.857911]\n",
  409. "[2022-04-27 21:51:48.577854] [Epoch 10; 300] [Time 0.594] [Data 0.853] [LR 0.97027]\n",
  410. "[LossC 0.000000] [LossSim 4.266364] [LossShift 0.833280]\n",
  411. "[2022-04-27 21:52:11.521917] [Epoch 10; 350] [Time 0.470] [Data 0.921] [LR 0.98031]\n",
  412. "[LossC 0.000000] [LossSim 4.421701] [LossShift 0.852391]\n",
  413. "[2022-04-27 21:52:34.254971] [Epoch 10; 400] [Time 0.472] [Data 1.054] [LR 0.99036]\n",
  414. "[LossC 0.000000] [LossSim 4.423033] [LossShift 0.933093]\n",
  415. "[2022-04-27 21:52:55.124955] [DONE] [Time 0.491] [Data 0.912] [LossC 0.000000] [LossSim 4.332921] [LossShift 0.889218]\n"
  416. ]
  417. }
  418. ],
  419. "source": [
  420. "# TRAINING\n",
  421. "# dataset : CNMC\n",
  422. "# res : 450px\n",
  423. "# id_class : hem\n",
  424. "# epoch : 100\n",
  425. "# shift_tr : blur_randpers\n",
  426. "# crop : 0.08\n",
  427. "# color_dist : 0.5\n",
  428. "# blur_sigma : 40\n",
  429. "# randpers : 0.8\n",
  430. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --blur_sigma 40 --distortion_scale 0.8 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur_randpers --epochs 10 --batch_size 8 --resize_factor 0.08 --optimizer sgd --one_class_idx 1 --res 450px"
  431. ]
  432. },
  433. {
  434. "cell_type": "code",
  435. "execution_count": null,
  436. "id": "3ec34e63",
  437. "metadata": {},
  438. "outputs": [
  439. {
  440. "name": "stdout",
  441. "output_type": "stream",
  442. "text": [
  443. "/home/feoktistovar67431/.local/lib/python3.6/site-packages/torch/distributed/launch.py:186: FutureWarning: The module torch.distributed.launch is deprecated\n",
  444. "and will be removed in future. Use torchrun.\n",
  445. "Note that --use_env is set by default in torchrun.\n",
  446. "If your script expects `--local_rank` argument to be set, please\n",
  447. "change it to read from `os.environ['LOCAL_RANK']` instead. See \n",
  448. "https://pytorch.org/docs/stable/distributed.html#launch-utility for \n",
  449. "further instructions\n",
  450. "\n",
  451. " FutureWarning,\n",
  452. "WARNING:torch.distributed.run:\n",
  453. "*****************************************\n",
  454. "Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. \n",
  455. "*****************************************\n",
  456. "Warning: using Python fallback for SyncBatchNorm, possibly because apex was installed without --cuda_ext. The exception raised when attempting to import the cuda backend was: No module named 'syncbn'\n",
  457. "Warning: apex was installed without --cpp_ext. Falling back to Python flatten and unflatten.\n",
  458. "Warning: using Python fallback for SyncBatchNorm, possibly because apex was installed without --cuda_ext. The exception raised when attempting to import the cuda backend was: No module named 'syncbn'\n",
  459. "Warning: apex was installed without --cpp_ext. Falling back to Python flatten and unflatten.\n",
  460. "[2022-04-27 21:53:02.070110] Namespace(K_shift=4, batch_size=8, blur_sigma=40.0, color_distort=0.5, dataset='CNMC', distortion_scale=0.6, epochs=10, error_step=5, image_size=(300, 300, 3), load_path=None, local_rank=0, lr_init=0.1, lr_scheduler='cosine', mode='simclr_CSI', model='resnet18_imagenet', multi_gpu=True, n_classes=2, n_gpus=2, n_superclasses=2, no_strict=False, noise_mean=0, noise_std=0.3, one_class_idx=1, ood_batch_size=100, ood_dataset=[0], ood_layer='simclr', ood_samples=1, ood_score=['norm_mean'], optimizer='sgd', print_score=False, proc_step=None, res='450px', resize_factor=0.08, resize_fix=False, resume_path=None, save_score=False, save_step=10, sharpness_factor=128.0, shift_trans=BlurSharpness(\n",
  461. " (gauss): GaussBlur()\n",
  462. " (sharp): RandomAdjustSharpness()\n",
  463. "), shift_trans_type='blur_sharp', sim_lambda=1.0, simclr_dim=128, suffix=None, temperature=0.5, test_batch_size=100, warmup=10, weight_decay=1e-06)\n",
  464. "[2022-04-27 21:53:02.070601] DistributedDataParallel(\n",
  465. " (module): ResNet(\n",
  466. " (linear): Linear(in_features=512, out_features=2, bias=True)\n",
  467. " (simclr_layer): Sequential(\n",
  468. " (0): Linear(in_features=512, out_features=512, bias=True)\n",
  469. " (1): ReLU()\n",
  470. " (2): Linear(in_features=512, out_features=128, bias=True)\n",
  471. " )\n",
  472. " (shift_cls_layer): Linear(in_features=512, out_features=4, bias=True)\n",
  473. " (joint_distribution_layer): Linear(in_features=512, out_features=8, bias=True)\n",
  474. " (conv1): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)\n",
  475. " (bn1): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  476. " (relu): ReLU(inplace=True)\n",
  477. " (maxpool): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n",
  478. " (layer1): Sequential(\n",
  479. " (0): BasicBlock(\n",
  480. " (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  481. " (bn1): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  482. " (relu): ReLU(inplace=True)\n",
  483. " (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  484. " (bn2): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  485. " )\n",
  486. " (1): BasicBlock(\n",
  487. " (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  488. " (bn1): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  489. " (relu): ReLU(inplace=True)\n",
  490. " (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  491. " (bn2): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  492. " )\n",
  493. " )\n",
  494. " (layer2): Sequential(\n",
  495. " (0): BasicBlock(\n",
  496. " (conv1): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)\n",
  497. " (bn1): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  498. " (relu): ReLU(inplace=True)\n",
  499. " (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  500. " (bn2): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  501. " (downsample): Sequential(\n",
  502. " (0): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
  503. " (1): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  504. " )\n",
  505. " )\n",
  506. " (1): BasicBlock(\n",
  507. " (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  508. " (bn1): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  509. " (relu): ReLU(inplace=True)\n",
  510. " (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  511. " (bn2): SyncBatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  512. " )\n",
  513. " )\n",
  514. " (layer3): Sequential(\n",
  515. " (0): BasicBlock(\n",
  516. " (conv1): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)\n",
  517. " (bn1): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  518. " (relu): ReLU(inplace=True)\n",
  519. " (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  520. " (bn2): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  521. " (downsample): Sequential(\n",
  522. " (0): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
  523. " (1): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  524. " )\n",
  525. " )\n",
  526. " (1): BasicBlock(\n",
  527. " (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  528. " (bn1): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  529. " (relu): ReLU(inplace=True)\n",
  530. " (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  531. " (bn2): SyncBatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  532. " )\n",
  533. " )\n",
  534. " (layer4): Sequential(\n",
  535. " (0): BasicBlock(\n",
  536. " (conv1): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)\n",
  537. " (bn1): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  538. " (relu): ReLU(inplace=True)\n",
  539. " (conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  540. " (bn2): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  541. " (downsample): Sequential(\n",
  542. " (0): Conv2d(256, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)\n",
  543. " (1): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  544. " )\n",
  545. " )\n",
  546. " (1): BasicBlock(\n",
  547. " (conv1): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  548. " (bn1): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  549. " (relu): ReLU(inplace=True)\n",
  550. " (conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n",
  551. " (bn2): SyncBatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
  552. " )\n",
  553. " )\n",
  554. " (avgpool): AdaptiveAvgPool2d(output_size=(1, 1))\n",
  555. " (normalize): NormalizeLayer()\n",
  556. " )\n",
  557. ")\n",
  558. "Epoch 1 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  559. "/home/feoktistovar67431/.local/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:154: UserWarning: The epoch parameter in `scheduler.step()` was not necessary and is being deprecated where possible. Please use `scheduler.step()` to step the scheduler. During the deprecation, if epoch is different from None, the closed form is used instead of the new chainable form, where available. Please open an issue if you are unable to replicate your use case: https://github.com/pytorch/pytorch/issues/new/choose.\n",
  560. " warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)\n"
  561. ]
  562. },
  563. {
  564. "name": "stdout",
  565. "output_type": "stream",
  566. "text": [
  567. "/home/feoktistovar67431/.local/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:154: UserWarning: The epoch parameter in `scheduler.step()` was not necessary and is being deprecated where possible. Please use `scheduler.step()` to step the scheduler. During the deprecation, if epoch is different from None, the closed form is used instead of the new chainable form, where available. Please open an issue if you are unable to replicate your use case: https://github.com/pytorch/pytorch/issues/new/choose.\n",
  568. " warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)\n",
  569. "[2022-04-27 21:53:04.749961] [Epoch 1; 0] [Time 1.525] [Data 0.149] [LR 0.10000]\n",
  570. "[LossC 0.000000] [LossSim 4.858340] [LossShift 1.407876]\n",
  571. "[2022-04-27 21:53:25.624987] [Epoch 1; 50] [Time 0.458] [Data 0.878] [LR 0.11004]\n",
  572. "[LossC 0.000000] [LossSim 4.845747] [LossShift 1.667100]\n",
  573. "[2022-04-27 21:53:47.668063] [Epoch 1; 100] [Time 0.474] [Data 0.893] [LR 0.12009]\n",
  574. "[LossC 0.000000] [LossSim 4.844110] [LossShift 1.436306]\n",
  575. "[2022-04-27 21:54:10.188214] [Epoch 1; 150] [Time 0.454] [Data 0.867] [LR 0.13013]\n",
  576. "[LossC 0.000000] [LossSim 4.843646] [LossShift 1.547756]\n",
  577. "[2022-04-27 21:54:33.381892] [Epoch 1; 200] [Time 0.517] [Data 0.932] [LR 0.14018]\n",
  578. "[LossC 0.000000] [LossSim 4.738900] [LossShift 1.359678]\n",
  579. "[2022-04-27 21:54:56.617839] [Epoch 1; 250] [Time 0.469] [Data 1.055] [LR 0.15022]\n",
  580. "[LossC 0.000000] [LossSim 4.796278] [LossShift 1.271640]\n",
  581. "[2022-04-27 21:55:19.371901] [Epoch 1; 300] [Time 0.469] [Data 0.898] [LR 0.16027]\n",
  582. "[LossC 0.000000] [LossSim 4.608876] [LossShift 1.552633]\n",
  583. "[2022-04-27 21:55:42.571197] [Epoch 1; 350] [Time 0.516] [Data 0.918] [LR 0.17031]\n",
  584. "[LossC 0.000000] [LossSim 4.842148] [LossShift 1.336090]\n",
  585. "[2022-04-27 21:56:05.642156] [Epoch 1; 400] [Time 0.523] [Data 0.867] [LR 0.18036]\n",
  586. "[LossC 0.000000] [LossSim 4.832942] [LossShift 1.156906]\n",
  587. "[2022-04-27 21:56:26.681201] [DONE] [Time 0.489] [Data 0.909] [LossC 0.000000] [LossSim 4.770748] [LossShift 1.591873]\n",
  588. "Epoch 2 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  589. "[2022-04-27 21:56:27.693232] [Epoch 2; 0] [Time 0.440] [Data 0.148] [LR 0.19000]\n",
  590. "[LossC 0.000000] [LossSim 4.602440] [LossShift 1.091861]\n",
  591. "[2022-04-27 21:56:50.382773] [Epoch 2; 50] [Time 0.515] [Data 0.877] [LR 0.20004]\n",
  592. "[LossC 0.000000] [LossSim 4.600789] [LossShift 1.042183]\n",
  593. "[2022-04-27 21:57:13.401066] [Epoch 2; 100] [Time 0.472] [Data 0.977] [LR 0.21009]\n",
  594. "[LossC 0.000000] [LossSim 4.711175] [LossShift 1.322048]\n",
  595. "[2022-04-27 21:57:36.339250] [Epoch 2; 150] [Time 0.608] [Data 0.852] [LR 0.22013]\n",
  596. "[LossC 0.000000] [LossSim 4.559575] [LossShift 1.136288]\n",
  597. "[2022-04-27 21:57:59.495503] [Epoch 2; 200] [Time 0.467] [Data 1.097] [LR 0.23018]\n",
  598. "[LossC 0.000000] [LossSim 4.471087] [LossShift 1.055894]\n",
  599. "[2022-04-27 21:58:22.207180] [Epoch 2; 250] [Time 0.498] [Data 0.879] [LR 0.24022]\n",
  600. "[LossC 0.000000] [LossSim 4.526820] [LossShift 0.970052]\n",
  601. "[2022-04-27 21:58:45.158632] [Epoch 2; 300] [Time 0.468] [Data 1.074] [LR 0.25027]\n",
  602. "[LossC 0.000000] [LossSim 4.660821] [LossShift 1.274141]\n",
  603. "[2022-04-27 21:59:08.291492] [Epoch 2; 350] [Time 0.482] [Data 0.860] [LR 0.26031]\n",
  604. "[LossC 0.000000] [LossSim 4.487653] [LossShift 0.929607]\n",
  605. "[2022-04-27 21:59:31.435978] [Epoch 2; 400] [Time 0.469] [Data 1.006] [LR 0.27036]\n",
  606. "[LossC 0.000000] [LossSim 4.729589] [LossShift 1.065959]\n",
  607. "[2022-04-27 21:59:52.467171] [DONE] [Time 0.494] [Data 0.915] [LossC 0.000000] [LossSim 4.540043] [LossShift 1.051491]\n",
  608. "Epoch 3 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  609. "[2022-04-27 21:59:53.543037] [Epoch 3; 0] [Time 0.515] [Data 0.131] [LR 0.28000]\n",
  610. "[LossC 0.000000] [LossSim 4.606118] [LossShift 1.089750]\n",
  611. "[2022-04-27 22:00:16.551717] [Epoch 3; 50] [Time 0.454] [Data 0.864] [LR 0.29004]\n",
  612. "[LossC 0.000000] [LossSim 4.470480] [LossShift 1.156890]\n",
  613. "[2022-04-27 22:00:39.247741] [Epoch 3; 100] [Time 0.463] [Data 0.960] [LR 0.30009]\n",
  614. "[LossC 0.000000] [LossSim 4.465283] [LossShift 1.034453]\n",
  615. "[2022-04-27 22:01:02.437289] [Epoch 3; 150] [Time 0.485] [Data 0.857] [LR 0.31013]\n",
  616. "[LossC 0.000000] [LossSim 4.579294] [LossShift 1.223945]\n",
  617. "[2022-04-27 22:01:25.646166] [Epoch 3; 200] [Time 0.458] [Data 0.864] [LR 0.32018]\n",
  618. "[LossC 0.000000] [LossSim 4.475991] [LossShift 0.937372]\n",
  619. "[2022-04-27 22:01:48.449946] [Epoch 3; 250] [Time 0.472] [Data 0.846] [LR 0.33022]\n",
  620. "[LossC 0.000000] [LossSim 4.492799] [LossShift 1.123910]\n",
  621. "[2022-04-27 22:02:11.088044] [Epoch 3; 300] [Time 0.584] [Data 0.884] [LR 0.34027]\n",
  622. "[LossC 0.000000] [LossSim 4.520730] [LossShift 1.016755]\n",
  623. "[2022-04-27 22:02:34.026722] [Epoch 3; 350] [Time 0.462] [Data 0.904] [LR 0.35031]\n",
  624. "[LossC 0.000000] [LossSim 4.588828] [LossShift 1.008489]\n",
  625. "[2022-04-27 22:02:57.093785] [Epoch 3; 400] [Time 0.468] [Data 1.008] [LR 0.36036]\n",
  626. "[LossC 0.000000] [LossSim 4.431605] [LossShift 0.948913]\n",
  627. "[2022-04-27 22:03:18.112107] [DONE] [Time 0.493] [Data 0.914] [LossC 0.000000] [LossSim 4.458634] [LossShift 1.007948]\n",
  628. "Epoch 4 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  629. "[2022-04-27 22:03:19.173064] [Epoch 4; 0] [Time 0.486] [Data 0.144] [LR 0.37000]\n",
  630. "[LossC 0.000000] [LossSim 4.522823] [LossShift 0.872640]\n",
  631. "[2022-04-27 22:03:41.681406] [Epoch 4; 50] [Time 0.515] [Data 0.965] [LR 0.38004]\n",
  632. "[LossC 0.000000] [LossSim 4.627268] [LossShift 1.079998]\n",
  633. "[2022-04-27 22:04:04.353249] [Epoch 4; 100] [Time 0.456] [Data 0.890] [LR 0.39009]\n",
  634. "[LossC 0.000000] [LossSim 4.401687] [LossShift 1.002750]\n",
  635. "[2022-04-27 22:04:27.711134] [Epoch 4; 150] [Time 0.474] [Data 0.937] [LR 0.40013]\n",
  636. "[LossC 0.000000] [LossSim 4.423962] [LossShift 0.875453]\n",
  637. "[2022-04-27 22:04:50.564132] [Epoch 4; 200] [Time 0.535] [Data 0.917] [LR 0.41018]\n",
  638. "[LossC 0.000000] [LossSim 4.401275] [LossShift 0.953443]\n",
  639. "[2022-04-27 22:05:13.697441] [Epoch 4; 250] [Time 0.459] [Data 0.858] [LR 0.42022]\n",
  640. "[LossC 0.000000] [LossSim 4.430320] [LossShift 0.948798]\n",
  641. "[2022-04-27 22:05:36.625607] [Epoch 4; 300] [Time 0.475] [Data 0.875] [LR 0.43027]\n",
  642. "[LossC 0.000000] [LossSim 4.321131] [LossShift 0.913674]\n",
  643. "[2022-04-27 22:05:59.610157] [Epoch 4; 350] [Time 0.462] [Data 0.924] [LR 0.44031]\n",
  644. "[LossC 0.000000] [LossSim 4.468315] [LossShift 0.879398]\n",
  645. "[2022-04-27 22:06:22.584148] [Epoch 4; 400] [Time 0.462] [Data 0.924] [LR 0.45036]\n",
  646. "[LossC 0.000000] [LossSim 4.320601] [LossShift 0.835482]\n",
  647. "[2022-04-27 22:06:43.326378] [DONE] [Time 0.492] [Data 0.912] [LossC 0.000000] [LossSim 4.410098] [LossShift 0.938872]\n",
  648. "Epoch 5 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  649. "[2022-04-27 22:06:44.342767] [Epoch 5; 0] [Time 0.473] [Data 0.149] [LR 0.46000]\n",
  650. "[LossC 0.000000] [LossSim 4.376451] [LossShift 0.939952]\n",
  651. "[2022-04-27 22:07:06.782078] [Epoch 5; 50] [Time 0.449] [Data 0.856] [LR 0.47004]\n",
  652. "[LossC 0.000000] [LossSim 4.396927] [LossShift 0.920150]\n",
  653. "[2022-04-27 22:07:29.728200] [Epoch 5; 100] [Time 0.463] [Data 0.908] [LR 0.48009]\n",
  654. "[LossC 0.000000] [LossSim 4.447166] [LossShift 0.918573]\n",
  655. "[2022-04-27 22:07:52.322851] [Epoch 5; 150] [Time 0.473] [Data 1.023] [LR 0.49013]\n",
  656. "[LossC 0.000000] [LossSim 4.367201] [LossShift 0.944386]\n",
  657. "[2022-04-27 22:08:15.084181] [Epoch 5; 200] [Time 0.466] [Data 0.909] [LR 0.50018]\n",
  658. "[LossC 0.000000] [LossSim 4.325580] [LossShift 0.883697]\n",
  659. "[2022-04-27 22:08:37.787865] [Epoch 5; 250] [Time 0.521] [Data 0.937] [LR 0.51022]\n",
  660. "[LossC 0.000000] [LossSim 4.426981] [LossShift 0.855859]\n",
  661. "[2022-04-27 22:09:00.704213] [Epoch 5; 300] [Time 0.467] [Data 0.885] [LR 0.52027]\n",
  662. "[LossC 0.000000] [LossSim 4.355620] [LossShift 0.837514]\n",
  663. "[2022-04-27 22:09:23.448209] [Epoch 5; 350] [Time 0.482] [Data 0.899] [LR 0.53031]\n",
  664. "[LossC 0.000000] [LossSim 4.432379] [LossShift 0.906252]\n",
  665. "[2022-04-27 22:09:46.070029] [Epoch 5; 400] [Time 0.542] [Data 0.907] [LR 0.54036]\n",
  666. "[LossC 0.000000] [LossSim 4.362264] [LossShift 0.886713]\n",
  667. "[2022-04-27 22:10:06.772650] [DONE] [Time 0.486] [Data 0.904] [LossC 0.000000] [LossSim 4.392308] [LossShift 0.915971]\n",
  668. "Epoch 6 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  669. "[2022-04-27 22:10:07.752875] [Epoch 6; 0] [Time 0.446] [Data 0.148] [LR 0.55000]\n",
  670. "[LossC 0.000000] [LossSim 4.358101] [LossShift 0.934794]\n"
  671. ]
  672. },
  673. {
  674. "name": "stdout",
  675. "output_type": "stream",
  676. "text": [
  677. "[2022-04-27 22:10:30.582189] [Epoch 6; 50] [Time 0.484] [Data 0.911] [LR 0.56004]\n",
  678. "[LossC 0.000000] [LossSim 4.426515] [LossShift 0.982254]\n",
  679. "[2022-04-27 22:10:53.219031] [Epoch 6; 100] [Time 0.596] [Data 0.861] [LR 0.57009]\n",
  680. "[LossC 0.000000] [LossSim 4.355786] [LossShift 0.859021]\n",
  681. "[2022-04-27 22:11:16.124596] [Epoch 6; 150] [Time 0.591] [Data 0.880] [LR 0.58013]\n",
  682. "[LossC 0.000000] [LossSim 4.331424] [LossShift 0.872154]\n",
  683. "[2022-04-27 22:11:38.965621] [Epoch 6; 200] [Time 0.449] [Data 0.886] [LR 0.59018]\n",
  684. "[LossC 0.000000] [LossSim 4.351139] [LossShift 0.876345]\n",
  685. "[2022-04-27 22:12:01.754661] [Epoch 6; 250] [Time 0.461] [Data 0.920] [LR 0.60022]\n",
  686. "[LossC 0.000000] [LossSim 4.491778] [LossShift 1.031505]\n",
  687. "[2022-04-27 22:12:24.410563] [Epoch 6; 300] [Time 0.467] [Data 0.890] [LR 0.61027]\n",
  688. "[LossC 0.000000] [LossSim 4.340865] [LossShift 0.851271]\n",
  689. "[2022-04-27 22:12:47.216964] [Epoch 6; 350] [Time 0.467] [Data 0.897] [LR 0.62031]\n",
  690. "[LossC 0.000000] [LossSim 4.372048] [LossShift 0.921748]\n",
  691. "[2022-04-27 22:13:09.822383] [Epoch 6; 400] [Time 0.469] [Data 0.935] [LR 0.63036]\n",
  692. "[LossC 0.000000] [LossSim 4.349135] [LossShift 0.854723]\n",
  693. "[2022-04-27 22:13:30.781444] [DONE] [Time 0.487] [Data 0.907] [LossC 0.000000] [LossSim 4.368142] [LossShift 0.896633]\n",
  694. "Epoch 7 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  695. "[2022-04-27 22:13:31.766230] [Epoch 7; 0] [Time 0.455] [Data 0.133] [LR 0.64000]\n",
  696. "[LossC 0.000000] [LossSim 4.423601] [LossShift 0.868863]\n",
  697. "[2022-04-27 22:13:54.496806] [Epoch 7; 50] [Time 0.463] [Data 0.904] [LR 0.65004]\n",
  698. "[LossC 0.000000] [LossSim 4.383883] [LossShift 0.905446]\n",
  699. "[2022-04-27 22:14:17.511831] [Epoch 7; 100] [Time 0.470] [Data 1.031] [LR 0.66009]\n",
  700. "[LossC 0.000000] [LossSim 4.296111] [LossShift 0.895986]\n",
  701. "[2022-04-27 22:14:40.280189] [Epoch 7; 150] [Time 0.477] [Data 0.871] [LR 0.67013]\n",
  702. "[LossC 0.000000] [LossSim 4.305459] [LossShift 0.909102]\n",
  703. "[2022-04-27 22:15:03.937648] [Epoch 7; 200] [Time 0.513] [Data 1.929] [LR 0.68018]\n",
  704. "[LossC 0.000000] [LossSim 4.345171] [LossShift 0.866567]\n",
  705. "[2022-04-27 22:15:26.668402] [Epoch 7; 250] [Time 0.594] [Data 0.859] [LR 0.69022]\n",
  706. "[LossC 0.000000] [LossSim 4.381218] [LossShift 0.895947]\n",
  707. "[2022-04-27 22:15:49.487447] [Epoch 7; 300] [Time 0.473] [Data 0.861] [LR 0.70027]\n",
  708. "[LossC 0.000000] [LossSim 4.351787] [LossShift 0.836976]\n",
  709. "[2022-04-27 22:16:12.051757] [Epoch 7; 350] [Time 0.466] [Data 1.045] [LR 0.71031]\n",
  710. "[LossC 0.000000] [LossSim 4.400456] [LossShift 0.845599]\n",
  711. "[2022-04-27 22:16:34.818097] [Epoch 7; 400] [Time 0.468] [Data 0.849] [LR 0.72036]\n",
  712. "[LossC 0.000000] [LossSim 4.433661] [LossShift 1.035500]\n",
  713. "[2022-04-27 22:16:56.032426] [DONE] [Time 0.491] [Data 0.912] [LossC 0.000000] [LossSim 4.370436] [LossShift 0.907309]\n",
  714. "Epoch 8 (logs/CNMC_resnet18_imagenet_unsup_simclr_CSI_450px_shift_blur_sharp_resize_factor0.08_color_dist0.5_one_class_1)\n",
  715. "[2022-04-27 22:16:57.048328] [Epoch 8; 0] [Time 0.470] [Data 0.160] [LR 0.73000]\n",
  716. "[LossC 0.000000] [LossSim 4.345762] [LossShift 0.854992]\n"
  717. ]
  718. }
  719. ],
  720. "source": [
  721. "# TRAINING\n",
  722. "# dataset : CNMC\n",
  723. "# res : 450px\n",
  724. "# id_class : hem\n",
  725. "# epoch : 100\n",
  726. "# shift_tr : blur_sharp\n",
  727. "# crop : 0.08\n",
  728. "# color_dist : 0.5\n",
  729. "# sharp : 128\n",
  730. "# blur_sigma : 40\n",
  731. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --blur_sigma 40 --sharpness_factor 128 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur_sharp --epochs 10 --batch_size 8 --resize_factor 0.08 --optimizer sgd --one_class_idx 1 --res 450px"
  732. ]
  733. },
  734. {
  735. "cell_type": "code",
  736. "execution_count": null,
  737. "id": "cb3bca71",
  738. "metadata": {},
  739. "outputs": [],
  740. "source": [
  741. "# TRAINING\n",
  742. "# dataset : CNMC\n",
  743. "# res : 450px\n",
  744. "# id_class : hem\n",
  745. "# epoch : 100\n",
  746. "# shift_tr : randpers_sharp\n",
  747. "# crop : 0.08\n",
  748. "# color_dist : 0.5\n",
  749. "# sharp : 128\n",
  750. "# randpers : 0.8\n",
  751. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 128 --distortion_scale 0.8 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers_sharp --epochs 10 --batch_size 8 --resize_factor 0.08 --optimizer sgd --one_class_idx 1 --res 450px"
  752. ]
  753. },
  754. {
  755. "cell_type": "code",
  756. "execution_count": null,
  757. "id": "baf0eff6",
  758. "metadata": {},
  759. "outputs": [],
  760. "source": [
  761. "# TRAINING\n",
  762. "# dataset : CNMC\n",
  763. "# res : 450px\n",
  764. "# id_class : hem\n",
  765. "# epoch : 100\n",
  766. "# shift_tr : blur_randpers_sharp\n",
  767. "# crop : 0.08\n",
  768. "# color_dist : 0.5\n",
  769. "# sharp : 128\n",
  770. "# blur_sigma : 40\n",
  771. "# randpers : 0.8\n",
  772. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --blur_sigma 40 --sharpness_factor 128 --distortion_scale 0.8 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur_randpers_sharp --epochs 10 --batch_size 8 --resize_factor 0.08 --optimizer sgd --one_class_idx 1 --res 450px"
  773. ]
  774. },
  775. {
  776. "cell_type": "markdown",
  777. "id": "30642f7c",
  778. "metadata": {},
  779. "source": [
  780. "# Rotation"
  781. ]
  782. },
  783. {
  784. "cell_type": "code",
  785. "execution_count": null,
  786. "id": "d3be9f07",
  787. "metadata": {},
  788. "outputs": [],
  789. "source": [
  790. "# TRAINING\n",
  791. "# dataset : CNMC\n",
  792. "# res : 450px\n",
  793. "# id_class : hem\n",
  794. "# epoch : 100\n",
  795. "# shift_tr : rotation\n",
  796. "# crop : 0.08\n",
  797. "# color_dist : 0.5\n",
  798. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type rotation --epochs 10 --batch_size 8 --resize_factor 0.08 --optimizer sgd --one_class_idx 1 --res 450px"
  799. ]
  800. },
  801. {
  802. "cell_type": "markdown",
  803. "id": "d5b3adfc",
  804. "metadata": {},
  805. "source": [
  806. "# Cutperm"
  807. ]
  808. },
  809. {
  810. "cell_type": "code",
  811. "execution_count": null,
  812. "id": "f2a006f7",
  813. "metadata": {},
  814. "outputs": [],
  815. "source": [
  816. "# TRAINING\n",
  817. "# dataset : CNMC\n",
  818. "# res : 450px\n",
  819. "# id_class : hem\n",
  820. "# epoch : 100\n",
  821. "# shift_tr : rotation\n",
  822. "# crop : 0.08\n",
  823. "# color_dist : 0.5\n",
  824. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type cutperm --epochs 10 --batch_size 8 --resize_factor 0.08 --optimizer sgd --one_class_idx 1 --res 450px"
  825. ]
  826. },
  827. {
  828. "cell_type": "markdown",
  829. "id": "dff09fe7",
  830. "metadata": {},
  831. "source": [
  832. "# Adjust Sharpness"
  833. ]
  834. },
  835. {
  836. "cell_type": "code",
  837. "execution_count": null,
  838. "id": "695ed30c",
  839. "metadata": {},
  840. "outputs": [],
  841. "source": [
  842. "# TRAINING\n",
  843. "# dataset : CNMC\n",
  844. "# res : 450px\n",
  845. "# id_class : hem\n",
  846. "# epoch : 100\n",
  847. "# shift_tr : sharp\n",
  848. "# crop : 0.08\n",
  849. "# color_dist : 0.5\n",
  850. "# sharp : 4096\n",
  851. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 4096 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 10 --batch_size 8 --optimizer sgd --one_class_idx 1"
  852. ]
  853. },
  854. {
  855. "cell_type": "code",
  856. "execution_count": null,
  857. "id": "3537b825",
  858. "metadata": {},
  859. "outputs": [],
  860. "source": [
  861. "# TRAINING\n",
  862. "# dataset : CNMC\n",
  863. "# res : 450px\n",
  864. "# id_class : hem\n",
  865. "# epoch : 100\n",
  866. "# shift_tr : sharp\n",
  867. "# crop : 0.08\n",
  868. "# color_dist : 0.5\n",
  869. "# sharp : 2048\n",
  870. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 2048 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  871. ]
  872. },
  873. {
  874. "cell_type": "code",
  875. "execution_count": null,
  876. "id": "a6495274",
  877. "metadata": {},
  878. "outputs": [],
  879. "source": [
  880. "# TRAINING\n",
  881. "# dataset : CNMC\n",
  882. "# res : 450px\n",
  883. "# id_class : hem\n",
  884. "# epoch : 100\n",
  885. "# shift_tr : sharp\n",
  886. "# crop : 0.08\n",
  887. "# color_dist : 0.5\n",
  888. "# sharp : 1024\n",
  889. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 1024 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  890. ]
  891. },
  892. {
  893. "cell_type": "code",
  894. "execution_count": null,
  895. "id": "3f9a0fe8",
  896. "metadata": {},
  897. "outputs": [],
  898. "source": [
  899. "# TRAINING\n",
  900. "# dataset : CNMC\n",
  901. "# res : 450px\n",
  902. "# id_class : hem\n",
  903. "# epoch : 100\n",
  904. "# shift_tr : sharp\n",
  905. "# crop : 0.08\n",
  906. "# color_dist : 0.5\n",
  907. "# sharp : 512\n",
  908. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 512 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  909. ]
  910. },
  911. {
  912. "cell_type": "code",
  913. "execution_count": null,
  914. "id": "44688e2b",
  915. "metadata": {},
  916. "outputs": [],
  917. "source": [
  918. "# TRAINING\n",
  919. "# dataset : CNMC\n",
  920. "# res : 450px\n",
  921. "# id_class : hem\n",
  922. "# epoch : 100\n",
  923. "# shift_tr : sharp\n",
  924. "# crop : 0.08\n",
  925. "# color_dist : 0.5\n",
  926. "# sharp : 256\n",
  927. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 256 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  928. ]
  929. },
  930. {
  931. "cell_type": "code",
  932. "execution_count": null,
  933. "id": "e97c21fe",
  934. "metadata": {},
  935. "outputs": [],
  936. "source": [
  937. "# TRAINING\n",
  938. "# dataset : CNMC\n",
  939. "# res : 450px\n",
  940. "# id_class : hem\n",
  941. "# epoch : 100\n",
  942. "# shift_tr : sharp\n",
  943. "# crop : 0.08\n",
  944. "# color_dist : 0.5\n",
  945. "# sharp : 150\n",
  946. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 150 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  947. ]
  948. },
  949. {
  950. "cell_type": "code",
  951. "execution_count": null,
  952. "id": "9ecf758b",
  953. "metadata": {},
  954. "outputs": [],
  955. "source": [
  956. "# TRAINING\n",
  957. "# dataset : CNMC\n",
  958. "# res : 450px\n",
  959. "# id_class : hem\n",
  960. "# epoch : 100\n",
  961. "# shift_tr : sharp\n",
  962. "# crop : 0.08\n",
  963. "# color_dist : 0.5\n",
  964. "# sharp : 140\n",
  965. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 140 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  966. ]
  967. },
  968. {
  969. "cell_type": "code",
  970. "execution_count": null,
  971. "id": "0d9767a5",
  972. "metadata": {},
  973. "outputs": [],
  974. "source": [
  975. "# TRAINING\n",
  976. "# dataset : CNMC\n",
  977. "# res : 450px\n",
  978. "# id_class : hem\n",
  979. "# epoch : 100\n",
  980. "# shift_tr : sharp\n",
  981. "# crop : 0.08\n",
  982. "# color_dist : 0.5\n",
  983. "# sharp : 130\n",
  984. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 130 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  985. ]
  986. },
  987. {
  988. "cell_type": "code",
  989. "execution_count": null,
  990. "id": "bd662097",
  991. "metadata": {},
  992. "outputs": [],
  993. "source": [
  994. "# TRAINING\n",
  995. "# dataset : CNMC\n",
  996. "# res : 450px\n",
  997. "# id_class : hem\n",
  998. "# epoch : 100\n",
  999. "# shift_tr : sharp\n",
  1000. "# crop : 0.08\n",
  1001. "# color_dist : 0.5\n",
  1002. "# sharp : 128\n",
  1003. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 128 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  1004. ]
  1005. },
  1006. {
  1007. "cell_type": "code",
  1008. "execution_count": null,
  1009. "id": "a7c01b6f",
  1010. "metadata": {},
  1011. "outputs": [],
  1012. "source": [
  1013. "# TRAINING\n",
  1014. "# dataset : CNMC\n",
  1015. "# res : 450px\n",
  1016. "# id_class : hem\n",
  1017. "# epoch : 100\n",
  1018. "# shift_tr : sharp\n",
  1019. "# crop : 0.08\n",
  1020. "# color_dist : 0.5\n",
  1021. "# sharp : 120\n",
  1022. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 120 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  1023. ]
  1024. },
  1025. {
  1026. "cell_type": "code",
  1027. "execution_count": null,
  1028. "id": "0d129e42",
  1029. "metadata": {},
  1030. "outputs": [],
  1031. "source": [
  1032. "# TRAINING\n",
  1033. "# dataset : CNMC\n",
  1034. "# res : 450px\n",
  1035. "# id_class : hem\n",
  1036. "# epoch : 100\n",
  1037. "# shift_tr : sharp\n",
  1038. "# crop : 0.08\n",
  1039. "# color_dist : 0.5\n",
  1040. "# sharp : 100\n",
  1041. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 100 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  1042. ]
  1043. },
  1044. {
  1045. "cell_type": "code",
  1046. "execution_count": null,
  1047. "id": "d70d2983",
  1048. "metadata": {},
  1049. "outputs": [],
  1050. "source": [
  1051. "# TRAINING\n",
  1052. "# dataset : CNMC\n",
  1053. "# res : 450px\n",
  1054. "# id_class : hem\n",
  1055. "# epoch : 100\n",
  1056. "# shift_tr : sharp\n",
  1057. "# crop : 0.08\n",
  1058. "# color_dist : 0.5\n",
  1059. "# sharp : 80\n",
  1060. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 80 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  1061. ]
  1062. },
  1063. {
  1064. "cell_type": "code",
  1065. "execution_count": null,
  1066. "id": "6b32d416",
  1067. "metadata": {},
  1068. "outputs": [],
  1069. "source": [
  1070. "# TRAINING\n",
  1071. "# dataset : CNMC\n",
  1072. "# res : 450px\n",
  1073. "# id_class : hem\n",
  1074. "# epoch : 100\n",
  1075. "# shift_tr : sharp\n",
  1076. "# crop : 0.08\n",
  1077. "# color_dist : 0.5\n",
  1078. "# sharp : 64\n",
  1079. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 64 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1080. ]
  1081. },
  1082. {
  1083. "cell_type": "code",
  1084. "execution_count": null,
  1085. "id": "cf996327",
  1086. "metadata": {},
  1087. "outputs": [],
  1088. "source": [
  1089. "# TRAINING\n",
  1090. "# dataset : CNMC\n",
  1091. "# res : 450px\n",
  1092. "# id_class : hem\n",
  1093. "# epoch : 100\n",
  1094. "# shift_tr : sharp\n",
  1095. "# crop : 0.08\n",
  1096. "# color_dist : 0.5\n",
  1097. "# sharp : 32\n",
  1098. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 32 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1099. ]
  1100. },
  1101. {
  1102. "cell_type": "code",
  1103. "execution_count": null,
  1104. "id": "4d841ffb",
  1105. "metadata": {},
  1106. "outputs": [],
  1107. "source": [
  1108. "# TRAINING\n",
  1109. "# dataset : CNMC\n",
  1110. "# res : 450px\n",
  1111. "# id_class : hem\n",
  1112. "# epoch : 100\n",
  1113. "# shift_tr : sharp\n",
  1114. "# crop : 0.08\n",
  1115. "# color_dist : 0.5\n",
  1116. "# sharp : 16\n",
  1117. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 16 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1118. ]
  1119. },
  1120. {
  1121. "cell_type": "code",
  1122. "execution_count": null,
  1123. "id": "fd929ab1",
  1124. "metadata": {},
  1125. "outputs": [],
  1126. "source": [
  1127. "# TRAINING\n",
  1128. "# dataset : CNMC\n",
  1129. "# res : 450px\n",
  1130. "# id_class : hem\n",
  1131. "# epoch : 100\n",
  1132. "# shift_tr : sharp\n",
  1133. "# crop : 0.08\n",
  1134. "# color_dist : 0.5\n",
  1135. "# sharp : 8\n",
  1136. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 8 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  1137. ]
  1138. },
  1139. {
  1140. "cell_type": "code",
  1141. "execution_count": null,
  1142. "id": "e1d33ea1",
  1143. "metadata": {},
  1144. "outputs": [],
  1145. "source": [
  1146. "# TRAINING\n",
  1147. "# dataset : CNMC\n",
  1148. "# res : 450px\n",
  1149. "# id_class : hem\n",
  1150. "# epoch : 100\n",
  1151. "# shift_tr : sharp\n",
  1152. "# crop : 0.08\n",
  1153. "# color_dist : 0.5\n",
  1154. "# sharp : 5\n",
  1155. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 5 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1156. ]
  1157. },
  1158. {
  1159. "cell_type": "code",
  1160. "execution_count": null,
  1161. "id": "0c1fd73c",
  1162. "metadata": {},
  1163. "outputs": [],
  1164. "source": [
  1165. "# TRAINING\n",
  1166. "# dataset : CNMC\n",
  1167. "# res : 450px\n",
  1168. "# id_class : hem\n",
  1169. "# epoch : 100\n",
  1170. "# shift_tr : sharp\n",
  1171. "# crop : 0.08\n",
  1172. "# color_dist : 0.5\n",
  1173. "# sharp : 4\n",
  1174. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 4 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1175. ]
  1176. },
  1177. {
  1178. "cell_type": "code",
  1179. "execution_count": null,
  1180. "id": "9395e2f2",
  1181. "metadata": {},
  1182. "outputs": [],
  1183. "source": [
  1184. "# TRAINING\n",
  1185. "# dataset : CNMC\n",
  1186. "# res : 450px\n",
  1187. "# id_class : hem\n",
  1188. "# epoch : 100\n",
  1189. "# shift_tr : sharp\n",
  1190. "# crop : 0.08\n",
  1191. "# color_dist : 0.5\n",
  1192. "# sharp : 3\n",
  1193. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 3 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1194. ]
  1195. },
  1196. {
  1197. "cell_type": "code",
  1198. "execution_count": null,
  1199. "id": "959cc49f",
  1200. "metadata": {},
  1201. "outputs": [],
  1202. "source": [
  1203. "# TRAINING\n",
  1204. "# dataset : CNMC\n",
  1205. "# res : 450px\n",
  1206. "# id_class : hem\n",
  1207. "# epoch : 100\n",
  1208. "# shift_tr : sharp\n",
  1209. "# crop : 0.08\n",
  1210. "# color_dist : 0.5\n",
  1211. "# sharp : 2\n",
  1212. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --sharpness_factor 2 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type sharp --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1213. ]
  1214. },
  1215. {
  1216. "cell_type": "markdown",
  1217. "id": "76fd693e",
  1218. "metadata": {},
  1219. "source": [
  1220. "# Random Perspective"
  1221. ]
  1222. },
  1223. {
  1224. "cell_type": "code",
  1225. "execution_count": null,
  1226. "id": "c6dfe547",
  1227. "metadata": {},
  1228. "outputs": [],
  1229. "source": [
  1230. "# TRAINING\n",
  1231. "# dataset : CNMC\n",
  1232. "# res : 450px\n",
  1233. "# id_class : all\n",
  1234. "# epoch : 100\n",
  1235. "# shift_tr : randpers\n",
  1236. "# crop : 0.08\n",
  1237. "# color_dist : 0.5\n",
  1238. "# randper_dist: 0.95\n",
  1239. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --distortion_scale 0.95 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers --epochs 10 --batch_size 8 --optimizer sgd --one_class_idx 0 "
  1240. ]
  1241. },
  1242. {
  1243. "cell_type": "code",
  1244. "execution_count": null,
  1245. "id": "ccc4b932",
  1246. "metadata": {},
  1247. "outputs": [],
  1248. "source": [
  1249. "# TRAINING\n",
  1250. "# dataset : CNMC\n",
  1251. "# res : 450px\n",
  1252. "# id_class : hem\n",
  1253. "# epoch : 100\n",
  1254. "# shift_tr : randpers\n",
  1255. "# crop : 0.08\n",
  1256. "# color_dist : 0.5\n",
  1257. "# randper_dist: 0.9\n",
  1258. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --distortion_scale 0.9 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1259. ]
  1260. },
  1261. {
  1262. "cell_type": "code",
  1263. "execution_count": null,
  1264. "id": "4148f1e6",
  1265. "metadata": {
  1266. "scrolled": false
  1267. },
  1268. "outputs": [],
  1269. "source": [
  1270. "# TRAINING\n",
  1271. "# dataset : CNMC\n",
  1272. "# res : 450px\n",
  1273. "# id_class : hem\n",
  1274. "# epoch : 100\n",
  1275. "# shift_tr : randpers\n",
  1276. "# crop : 0.08\n",
  1277. "# color_dist : 0.5\n",
  1278. "# randper_dist: 0.85\n",
  1279. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --distortion_scale 0.85 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1280. ]
  1281. },
  1282. {
  1283. "cell_type": "code",
  1284. "execution_count": null,
  1285. "id": "022d5ce0",
  1286. "metadata": {
  1287. "scrolled": false
  1288. },
  1289. "outputs": [],
  1290. "source": [
  1291. "# TRAINING\n",
  1292. "# dataset : CNMC\n",
  1293. "# res : 450px\n",
  1294. "# id_class : hem\n",
  1295. "# epoch : 100\n",
  1296. "# shift_tr : randpers\n",
  1297. "# crop : 0.08\n",
  1298. "# color_dist : 0.5\n",
  1299. "# randper_dist: 0.8\n",
  1300. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --distortion_scale 0.8 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1301. ]
  1302. },
  1303. {
  1304. "cell_type": "code",
  1305. "execution_count": null,
  1306. "id": "2bec00e6",
  1307. "metadata": {
  1308. "scrolled": false
  1309. },
  1310. "outputs": [],
  1311. "source": [
  1312. "# TRAINING\n",
  1313. "# dataset : CNMC\n",
  1314. "# res : 450px\n",
  1315. "# id_class : hem\n",
  1316. "# epoch : 100\n",
  1317. "# shift_tr : randpers\n",
  1318. "# crop : 0.08\n",
  1319. "# color_dist : 0.5\n",
  1320. "# randper_dist: 0.75\n",
  1321. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --distortion_scale 0.75 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1322. ]
  1323. },
  1324. {
  1325. "cell_type": "code",
  1326. "execution_count": null,
  1327. "id": "1875267e",
  1328. "metadata": {},
  1329. "outputs": [],
  1330. "source": [
  1331. "# TRAINING\n",
  1332. "# dataset : CNMC\n",
  1333. "# res : 450px\n",
  1334. "# id_class : hem\n",
  1335. "# epoch : 100\n",
  1336. "# shift_tr : randpers\n",
  1337. "# crop : 0.08\n",
  1338. "# color_dist : 0.5\n",
  1339. "# randper_dist: 0.6\n",
  1340. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --distortion_scale 0.6 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1"
  1341. ]
  1342. },
  1343. {
  1344. "cell_type": "code",
  1345. "execution_count": null,
  1346. "id": "a02ed7ec",
  1347. "metadata": {},
  1348. "outputs": [],
  1349. "source": [
  1350. "# TRAINING\n",
  1351. "# dataset : CNMC\n",
  1352. "# res : 450px\n",
  1353. "# id_class : hem\n",
  1354. "# epoch : 100\n",
  1355. "# shift_tr : randpers\n",
  1356. "# crop : 0.08\n",
  1357. "# color_dist : 0.5\n",
  1358. "# randper_dist: 0.3\n",
  1359. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --distortion_scale 0.3 --resize_factor 0.08 --res 450px --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type randpers --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1360. ]
  1361. },
  1362. {
  1363. "cell_type": "markdown",
  1364. "id": "d599ef3f",
  1365. "metadata": {},
  1366. "source": [
  1367. "## Examine crop"
  1368. ]
  1369. },
  1370. {
  1371. "cell_type": "code",
  1372. "execution_count": null,
  1373. "id": "7195ad51",
  1374. "metadata": {},
  1375. "outputs": [],
  1376. "source": [
  1377. "# TRAINING\n",
  1378. "# dataset : CNMC\n",
  1379. "# res : 450px\n",
  1380. "# id_class : all\n",
  1381. "# epoch : 100\n",
  1382. "# shift_tr : blur\n",
  1383. "# crop : 0.5\n",
  1384. "# blur_sigma : 2\n",
  1385. "# color_dist : 0.8\n",
  1386. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.5 --res 450px --blur_sigma 2 --color_distort 0.8 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 10 --batch_size 8 --optimizer sgd --one_class_idx 0 "
  1387. ]
  1388. },
  1389. {
  1390. "cell_type": "code",
  1391. "execution_count": null,
  1392. "id": "7401d0e7",
  1393. "metadata": {},
  1394. "outputs": [],
  1395. "source": [
  1396. "# TRAINING\n",
  1397. "# dataset : CNMC\n",
  1398. "# res : 450px\n",
  1399. "# id_class : all\n",
  1400. "# epoch : 100\n",
  1401. "# shift_tr : blur\n",
  1402. "# crop : 0.3\n",
  1403. "# blur_sigma : 2\n",
  1404. "# color_dist : 0.8\n",
  1405. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.3 --res 450px --blur_sigma 2 --color_distort 0.8 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 0 "
  1406. ]
  1407. },
  1408. {
  1409. "cell_type": "code",
  1410. "execution_count": null,
  1411. "id": "b88a2670",
  1412. "metadata": {},
  1413. "outputs": [],
  1414. "source": [
  1415. "# TRAINING\n",
  1416. "# dataset : CNMC\n",
  1417. "# res : 450px\n",
  1418. "# id_class : all\n",
  1419. "# epoch : 100\n",
  1420. "# shift_tr : blur\n",
  1421. "# crop : 0.02\n",
  1422. "# blur_sigma : 2\n",
  1423. "# color_dist : 0.8\n",
  1424. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.02 --res 450px --blur_sigma 2 --color_distort 0.8 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 0 "
  1425. ]
  1426. },
  1427. {
  1428. "cell_type": "code",
  1429. "execution_count": null,
  1430. "id": "83922b52",
  1431. "metadata": {},
  1432. "outputs": [],
  1433. "source": [
  1434. "# TRAINING\n",
  1435. "# dataset : CNMC\n",
  1436. "# res : 450px\n",
  1437. "# id_class : all\n",
  1438. "# epoch : 100\n",
  1439. "# shift_tr : blur\n",
  1440. "# crop : 0.008\n",
  1441. "# blur_sigma : 2\n",
  1442. "# color_dist : 0.8\n",
  1443. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.008 --res 450px --blur_sigma 2 --color_distort 0.8 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 0 "
  1444. ]
  1445. },
  1446. {
  1447. "cell_type": "markdown",
  1448. "id": "006079f3",
  1449. "metadata": {},
  1450. "source": [
  1451. "## Examine blur_sigma"
  1452. ]
  1453. },
  1454. {
  1455. "cell_type": "code",
  1456. "execution_count": null,
  1457. "id": "4b65d654",
  1458. "metadata": {},
  1459. "outputs": [],
  1460. "source": [
  1461. "# TRAINING\n",
  1462. "# dataset : CNMC\n",
  1463. "# res : 450px\n",
  1464. "# id_class : hem\n",
  1465. "# epoch : 100\n",
  1466. "# shift_tr : blur\n",
  1467. "# crop : 0.08\n",
  1468. "# blur_sigma : 180\n",
  1469. "# color_dist : 0.5\n",
  1470. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 180 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 10 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1471. ]
  1472. },
  1473. {
  1474. "cell_type": "code",
  1475. "execution_count": null,
  1476. "id": "8aa50f84",
  1477. "metadata": {},
  1478. "outputs": [],
  1479. "source": [
  1480. "# TRAINING\n",
  1481. "# dataset : CNMC\n",
  1482. "# res : 450px\n",
  1483. "# id_class : hem\n",
  1484. "# epoch : 100\n",
  1485. "# shift_tr : blur\n",
  1486. "# crop : 0.08\n",
  1487. "# blur_sigma : 120\n",
  1488. "# color_dist : 0.5\n",
  1489. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 120 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1490. ]
  1491. },
  1492. {
  1493. "cell_type": "code",
  1494. "execution_count": null,
  1495. "id": "f94522c3",
  1496. "metadata": {},
  1497. "outputs": [],
  1498. "source": [
  1499. "# TRAINING\n",
  1500. "# dataset : CNMC\n",
  1501. "# res : 450px\n",
  1502. "# id_class : hem\n",
  1503. "# epoch : 100\n",
  1504. "# shift_tr : blur\n",
  1505. "# crop : 0.08\n",
  1506. "# blur_sigma : 110\n",
  1507. "# color_dist : 0.5\n",
  1508. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 110 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1509. ]
  1510. },
  1511. {
  1512. "cell_type": "code",
  1513. "execution_count": null,
  1514. "id": "8bd4c63a",
  1515. "metadata": {},
  1516. "outputs": [],
  1517. "source": [
  1518. "# TRAINING\n",
  1519. "# dataset : CNMC\n",
  1520. "# res : 450px\n",
  1521. "# id_class : hem\n",
  1522. "# epoch : 100\n",
  1523. "# shift_tr : blur\n",
  1524. "# crop : 0.08\n",
  1525. "# blur_sigma : 105\n",
  1526. "# color_dist : 0.5\n",
  1527. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 105 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1528. ]
  1529. },
  1530. {
  1531. "cell_type": "code",
  1532. "execution_count": null,
  1533. "id": "cade09f1",
  1534. "metadata": {},
  1535. "outputs": [],
  1536. "source": [
  1537. "# TRAINING\n",
  1538. "# dataset : CNMC\n",
  1539. "# res : 450px\n",
  1540. "# id_class : hem\n",
  1541. "# epoch : 100\n",
  1542. "# shift_tr : blur\n",
  1543. "# crop : 0.08\n",
  1544. "# blur_sigma : 100\n",
  1545. "# color_dist : 0.5\n",
  1546. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 100 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1547. ]
  1548. },
  1549. {
  1550. "cell_type": "code",
  1551. "execution_count": null,
  1552. "id": "0f1af3f1",
  1553. "metadata": {},
  1554. "outputs": [],
  1555. "source": [
  1556. "# TRAINING\n",
  1557. "# dataset : CNMC\n",
  1558. "# res : 450px\n",
  1559. "# id_class : hem\n",
  1560. "# epoch : 100\n",
  1561. "# shift_tr : blur\n",
  1562. "# crop : 0.08\n",
  1563. "# blur_sigma : 95\n",
  1564. "# color_dist : 0.5\n",
  1565. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 95 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1566. ]
  1567. },
  1568. {
  1569. "cell_type": "code",
  1570. "execution_count": null,
  1571. "id": "e5b5e043",
  1572. "metadata": {},
  1573. "outputs": [],
  1574. "source": [
  1575. "# TRAINING\n",
  1576. "# dataset : CNMC\n",
  1577. "# res : 450px\n",
  1578. "# id_class : hem\n",
  1579. "# epoch : 100\n",
  1580. "# shift_tr : blur\n",
  1581. "# crop : 0.08\n",
  1582. "# blur_sigma : 90\n",
  1583. "# color_dist : 0.5\n",
  1584. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 90 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1585. ]
  1586. },
  1587. {
  1588. "cell_type": "code",
  1589. "execution_count": null,
  1590. "id": "f4c30628",
  1591. "metadata": {},
  1592. "outputs": [],
  1593. "source": [
  1594. "# TRAINING\n",
  1595. "# dataset : CNMC\n",
  1596. "# res : 450px\n",
  1597. "# id_class : hem\n",
  1598. "# epoch : 100\n",
  1599. "# shift_tr : blur\n",
  1600. "# crop : 0.08\n",
  1601. "# blur_sigma : 80\n",
  1602. "# color_dist : 0.5\n",
  1603. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --gauss_sigma 80 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1604. ]
  1605. },
  1606. {
  1607. "cell_type": "code",
  1608. "execution_count": null,
  1609. "id": "13a022fc",
  1610. "metadata": {},
  1611. "outputs": [],
  1612. "source": [
  1613. "# TRAINING\n",
  1614. "# dataset : CNMC\n",
  1615. "# res : 450px\n",
  1616. "# id_class : hem\n",
  1617. "# epoch : 100\n",
  1618. "# shift_tr : blur\n",
  1619. "# crop : 0.08\n",
  1620. "# blur_sigma : 60\n",
  1621. "# color_dist : 0.5\n",
  1622. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 60 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1623. ]
  1624. },
  1625. {
  1626. "cell_type": "code",
  1627. "execution_count": null,
  1628. "id": "02779f69",
  1629. "metadata": {},
  1630. "outputs": [],
  1631. "source": [
  1632. "# TRAINING\n",
  1633. "# dataset : CNMC\n",
  1634. "# res : 450px\n",
  1635. "# id_class : hem\n",
  1636. "# epoch : 100\n",
  1637. "# shift_tr : blur\n",
  1638. "# crop : 0.08\n",
  1639. "# blur_sigma : 40\n",
  1640. "# color_dist : 0.5\n",
  1641. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 40 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1642. ]
  1643. },
  1644. {
  1645. "cell_type": "code",
  1646. "execution_count": null,
  1647. "id": "b63a705a",
  1648. "metadata": {},
  1649. "outputs": [],
  1650. "source": [
  1651. "# TRAINING\n",
  1652. "# dataset : CNMC\n",
  1653. "# res : 450px\n",
  1654. "# id_class : hem\n",
  1655. "# epoch : 100\n",
  1656. "# shift_tr : blur\n",
  1657. "# crop : 0.08\n",
  1658. "# blur_sigma : 20\n",
  1659. "# color_dist : 0.5\n",
  1660. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 20 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1661. ]
  1662. },
  1663. {
  1664. "cell_type": "code",
  1665. "execution_count": null,
  1666. "id": "dde3e377",
  1667. "metadata": {},
  1668. "outputs": [],
  1669. "source": [
  1670. "# TRAINING\n",
  1671. "# dataset : CNMC\n",
  1672. "# res : 450px\n",
  1673. "# id_class : hem\n",
  1674. "# epoch : 100\n",
  1675. "# shift_tr : blur\n",
  1676. "# crop : 0.08\n",
  1677. "# blur_sigma : 6\n",
  1678. "# color_dist : 0.5\n",
  1679. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 6 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1680. ]
  1681. },
  1682. {
  1683. "cell_type": "code",
  1684. "execution_count": null,
  1685. "id": "c23c0e0a",
  1686. "metadata": {},
  1687. "outputs": [],
  1688. "source": [
  1689. "# TRAINING\n",
  1690. "# dataset : CNMC\n",
  1691. "# res : 450px\n",
  1692. "# id_class : hem\n",
  1693. "# epoch : 100\n",
  1694. "# shift_tr : blur\n",
  1695. "# crop : 0.08\n",
  1696. "# blur_sigma : 4\n",
  1697. "# color_dist : 0.5\n",
  1698. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 4 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1699. ]
  1700. },
  1701. {
  1702. "cell_type": "code",
  1703. "execution_count": null,
  1704. "id": "35fbd79f",
  1705. "metadata": {},
  1706. "outputs": [],
  1707. "source": [
  1708. "# TRAINING\n",
  1709. "# dataset : CNMC\n",
  1710. "# res : 450px\n",
  1711. "# id_class : hem\n",
  1712. "# epoch : 100\n",
  1713. "# shift_tr : blur\n",
  1714. "# crop : 0.08\n",
  1715. "# blur_sigma : 3\n",
  1716. "# color_dist : 0.5\n",
  1717. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 3 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1718. ]
  1719. },
  1720. {
  1721. "cell_type": "code",
  1722. "execution_count": null,
  1723. "id": "42510921",
  1724. "metadata": {},
  1725. "outputs": [],
  1726. "source": [
  1727. "# TRAINING\n",
  1728. "# dataset : CNMC\n",
  1729. "# res : 450px\n",
  1730. "# id_class : hem\n",
  1731. "# epoch : 100\n",
  1732. "# shift_tr : blur\n",
  1733. "# crop : 0.08\n",
  1734. "# blur_sigma : 2\n",
  1735. "# color_dist : 0.5\n",
  1736. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 2 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1737. ]
  1738. },
  1739. {
  1740. "cell_type": "code",
  1741. "execution_count": null,
  1742. "id": "7672da24",
  1743. "metadata": {},
  1744. "outputs": [],
  1745. "source": [
  1746. "# TRAINING\n",
  1747. "# dataset : CNMC\n",
  1748. "# res : 450px\n",
  1749. "# id_class : hem\n",
  1750. "# epoch : 100\n",
  1751. "# shift_tr : blur\n",
  1752. "# crop : 0.08\n",
  1753. "# blur_sigma : 1.5\n",
  1754. "# color_dist : 0.5\n",
  1755. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 1.5 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1756. ]
  1757. },
  1758. {
  1759. "cell_type": "code",
  1760. "execution_count": null,
  1761. "id": "1e94687e",
  1762. "metadata": {},
  1763. "outputs": [],
  1764. "source": [
  1765. "# TRAINING\n",
  1766. "# dataset : CNMC\n",
  1767. "# res : 450px\n",
  1768. "# id_class : hem\n",
  1769. "# epoch : 100\n",
  1770. "# shift_tr : blur\n",
  1771. "# crop : 0.08\n",
  1772. "# blur_sigma : 1\n",
  1773. "# color_dist : 0.5\n",
  1774. "!CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --nproc_per_node=2 \"train.py\" --resize_factor 0.08 --res 450px --blur_sigma 1 --color_distort 0.5 --dataset 'CNMC' --model 'resnet18_imagenet' --mode simclr_CSI --shift_trans_type blur --epochs 100 --batch_size 8 --optimizer sgd --one_class_idx 1 "
  1775. ]
  1776. }
  1777. ],
  1778. "metadata": {
  1779. "kernelspec": {
  1780. "display_name": "Python 3",
  1781. "language": "python",
  1782. "name": "python3"
  1783. },
  1784. "language_info": {
  1785. "codemirror_mode": {
  1786. "name": "ipython",
  1787. "version": 3
  1788. },
  1789. "file_extension": ".py",
  1790. "mimetype": "text/x-python",
  1791. "name": "python",
  1792. "nbconvert_exporter": "python",
  1793. "pygments_lexer": "ipython3",
  1794. "version": "3.6.9"
  1795. }
  1796. },
  1797. "nbformat": 4,
  1798. "nbformat_minor": 5
  1799. }