From 5593b400739ddfbacd5d3bed55b32a0962cfd7a4 Mon Sep 17 00:00:00 2001 From: limiteinductive Date: Thu, 7 Mar 2024 17:29:12 +0000 Subject: [PATCH] fix training 101 guide inconsistencies --- docs/guides/training_101/index.md | 9 ++++++--- docs/guides/training_101/sample-0.png | Bin 3415 -> 109 bytes docs/guides/training_101/sample-1.png | Bin 3477 -> 104 bytes docs/guides/training_101/sample-2.png | Bin 3435 -> 0 bytes 4 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 docs/guides/training_101/sample-2.png diff --git a/docs/guides/training_101/index.md b/docs/guides/training_101/index.md index 0db5ee9..15aa422 100644 --- a/docs/guides/training_101/index.md +++ b/docs/guides/training_101/index.md @@ -152,7 +152,7 @@ from PIL import Image from refiners.fluxion.utils import image_to_tensor def generate_mask(size: int, seed: int | None = None) -> Generator[torch.Tensor, None, None]: - """Generate a tensor of a grayscale mask of size `size` using random rectangles.""" + """Generate a tensor of a binary mask of size `size` using random rectangles.""" if seed is None: seed = random.randint(0, 2**32 - 1) random.seed(seed) @@ -186,10 +186,9 @@ mask = next(generate_mask(64, seed=42)) tensor_to_image(mask).save("mask.png") ``` -Here are a few examples of generated images: +Here are a two examples of generated masks: ![alt text](sample-0.png) ![alt text](sample-1.png) -![alt text](sample-2.png) ## Trainer @@ -445,6 +444,10 @@ class AutoencoderTrainer(Trainer[AutoencoderConfig, Batch]): ![alt text](loss-logging.png) +## Wrap up + +You can train this toy model using the code below: + ??? complete end-to-end code "Expand to see the full code." ```py diff --git a/docs/guides/training_101/sample-0.png b/docs/guides/training_101/sample-0.png index 0a2411dffaf585a0ed1fd68a4744042119cda706..e9f1c5ff474095e06aca1cf2f75306a3f58b074f 100644 GIT binary patch delta 90 zcmcaEl{-N)gaHWpne>=|l!>Q{V@SoEx91f37!(^-ZV ly)XK5*G>QmDhwD7Y-0$jVDxfL?N|dc$J5o%Wt~$(696UB9ew}+ literal 3415 zcmV-d4XE;oP)000a@X+uL$Nkc;* zP;zf(X>4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D zHWxMzoD`kxJC%Owam$pJyQe3dzTO(u+I}YV%=xo{XHTDFo@+kub^h1|j|)dGGA=e; za=ldF=F)cfcbDG}x4X92Uv|6Pc*XrnQ^&ZD6IXq%p1S6L?d)~-^-DLxZ*<&@yLqcK zxwGpQ?^e(4?Ax#I6x{iIciuh1z0&*Y_bVP4JgEM|=8wHyu3g6;`af)Y6!YlrWA5V@ zPx798=`MaseOmF%_*qSlQ_r#9z}_p*CqD0fA$sw-ujEgSKdW9^zdZDp?_X{G6Z*Sf ziC+!AUh+oo&5pOuZ(9Z;2Ohl3dH4B!=?A?JJ3lf$p8J&W>DlLLUr1lpezp19^eyz; zy}_KpK@msHk^Kr_u%T&b0KDD-05uT+8r+{zCd&7JGDGBhRv7~S3Cs70GIIr>4*tJK z^})ZJP5}08gWE5tua*ozBo%;IcYux^JKTo$YO;N$)QE5&usP;yYECNnHzwb6{*d?2 zXCPH|20x$w1&FPDad}(q7XSbNIAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q00000 z0-yo_1ONa40RR91K%fHv1ONa40RR91KmY&$0A-nAiU0rrjY&j7RA>e5(y8Mh~7Thz2hX4Tr1PBlyK!5-N0t5&UAV7cs0RjXF5O^qX?E7o2 zeg4Q{&UyPL=k1M;U+@8M2U0+RDBu^0fO%YjOc)m^5CQYJ0+}!_P#^;4aRoAAT%bS% t%;O4V!niP0vEDF12&ug8&UuO002ovPDHLkV1l?daC86w diff --git a/docs/guides/training_101/sample-1.png b/docs/guides/training_101/sample-1.png index 00ec019c0a5c36bbec8bd8c79237df5b98eece80..b44a582555483841036b7d90b9ca0072b22ddd3e 100644 GIT binary patch delta 85 zcmbO#oiRbup8*K^ne>=|l)k5nV@SoEx91dv7!-Jz4^I34f2LO3t0aNlTCdau8DuJ- l%duX2&CJNi*jUfRa6z<+n^FCg%Y(b6(@>k*d#@-`)mlZV8VORZQDU#s;<0Mh zP7y+lsJMOJ-1`UI7vJ;ye$F{>&dZZ(Vx-MT$3+JK02p<3w9Nj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<-MkG6f`muXh0cN!5rOnObN zajluhm8VwG)vp>Sx#tU0Hd8JC(kWP8_CX4bUeg)OL5hsO>(S=T+Lv?puO)msIdlVw zg3^o`ARLfuZ*COrD&|Mw{6_MSZB?K*UzWK3nU4}V9zAc0^)N1RDTb@ygGjTK+4S0A zX)wgWzr$jAb0YXG#`a?v9BI+^IORJ*X2dUtr1j7zLH>?|Hs(x^?>r^^^iHCY$ zvJ%^%sZho*PJ~DJuURc)KK4{X)O_tDp{M7OJJcQ56jh~FiZAjGcILKVP#x%W6y|*X z_}=l44(uDOI*ayb&Ly2Qstg7Lv@ekX9vmq z;&j|Yz%qzRwd9I2r7prR)P9fS?@uA;W~1wFXb2Gd>ofqeWEgn{KRuoU>; zj#?@C|NP&f+bid^zcHe#rEcL#xi^oc?KZhVX?hEJaM2*CEIf;iU(*Jz5f=r=dW!~v z92-E@eVhegzjP@-;&{8nB@xZP*QshA W(uN;>3l9AEJl%&zTJ;*vasL5TU6L^X diff --git a/docs/guides/training_101/sample-2.png b/docs/guides/training_101/sample-2.png deleted file mode 100644 index babbac610b17b10b424aeabeb108aaaa30f3c7fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3435 zcmbW4Ra_Gc7l%i8OiFs9G6WnUj*bCJgLLXpat@RlIl6lYOhhRGL8Jyul#tO43cSFO zRC1C7NrBJz=KJoyi|72G-#Itu_MiB`Scip?j}ZU>u;}S(oBd6Vf1#)RJ8v?rCISG= zFoc%Y13fJ*&;y_6t_Tko06;e}+nUbCyq`PY{sl(Eor1a~W}X^&i=rgvE2XYfRC&w| z4Y6yqQAvWf7GAf@Z3uDINn-vQl44KXOg*M~m>36|Y-%N*n`umiu7s?etdfrU} z)_UF*0y~)}UH9uj&uBFCVmpClRE5Db!z6Qw9JlUs&p%uC+*p-)Ex?{xAJzTD}9r5U{7w(9QRd${ISXh`( zXeG!<;A+*b)Nnt4uGB|GEds0cBGm~muAO}9Smlr=8Lq&y$q4UD;U8OCGot6uW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