๋ฐ˜์‘ํ˜•

๐Ÿ Python & library/Etc. 4

[Optuna] ๋”ฅ๋Ÿฌ๋‹ ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ ์ตœ์ ํ™”ํ•˜๊ธฐ

Optuna๋Š” ํŒŒ์ด์ฌ ๊ธฐ๋ฐ˜์˜ ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ ์ตœ์ ํ™” (hyperparameter optimization) ํ”„๋ ˆ์ž„์›Œํฌ๋กœ, ์‹ฌํ”Œํ•˜๊ณ  ์œ ์—ฐํ•œ API๋ฅผ ์ œ๊ณตํ•œ๋‹ค. ๋ณธ ๊ธ€์—์„œ๋Š” Optuna์˜ ์ฃผ์š” ๊ธฐ๋Šฅ๊ณผ ์‚ฌ์šฉ๋ฐฉ๋ฒ•์„ ๊ฐ„๋‹จํžˆ ์†Œ๊ฐœํ•˜๊ณ ์ž ํ•œ๋‹ค. ๊ณต์‹ Docs: https://optuna.readthedocs.io/en/stable/index.html Optuna: A hyperparameter optimization framework — Optuna 3.4.0 documentation © Copyright 2018, Optuna Contributors. Revision 4ea580fc. optuna.readthedocs.io Basic concepts Optuna๋Š” study์™€ trial์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ •์˜ํ•œ๋‹ค. Stu..

[Tensorboard] ์ฐจํŠธ ์ƒ‰๊น” ๋ณ€๊ฒฝํ•˜๊ธฐ

Tensorboard์—์„œ๋Š” ๊ฐ ์ฐจํŠธ์— ์ž๋™์œผ๋กœ ์ƒ‰๊น”์„ ํ• ๋‹นํ•œ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ๊ฐ€๋” ์ด ์ƒ‰๊น”์ด ์„œ๋กœ ๊ฒน์ณ์„œ ๋ถˆํŽธํ•  ๋•Œ๊ฐ€ ์žˆ๋‹ค.. ์•ˆํƒ€๊น๊ฒŒ๋„ Tensorboard์—์„œ ์ฐจํŠธ ์ƒ‰๊น” ๋ณ€๊ฒฝ์€ ์ง€์›ํ•˜์ง€ ์•Š๊ณ  ์žˆ๋‹ค๊ณ  ํ•œ๋‹ค. ๋Œ€์‹  ์™„์„ฑ๋œ ์ฐจํŠธ๋ฅผ ๊ทธ๋ฆผํŒŒ์ผ๋กœ ์ €์žฅํ•˜๊ฑฐ๋‚˜ ํ•  ๋•Œ ์ƒ‰๊น”์„ ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•˜๊ณ ์ž ํ•œ๋‹ค. 1. ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ ํ™œ์„ฑํ™” Tensorboard ํ™”๋ฉด์˜ ์ขŒ์ธก์ƒ๋‹จ์— Show data downloads links๋ฅผ ๋ˆŒ๋Ÿฌ ๋ฐ์ดํ„ฐ ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ์„ ํ™œ์„ฑํ™”ํ•œ๋‹ค. 2. ๋ฐ์ดํ„ฐ ๋‹ค์šด๋กœ๋“œ ์‚ฌ์šฉํ•  ์ฐจํŠธ์˜ ์ขŒ์ธก ํ•˜๋‹จ ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ .svg ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค. ๋‹ค์šด๋กœ๋“œ ๋ฐ›์€ ํŒŒ์ผ์€ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์—ด ์ˆ˜ ์žˆ๋‹ค. 3. ์ƒ‰๊น” ์ˆ˜์ • .svg ํŒŒ์ผ์„ text editor๋กœ ์—ด์–ด ๊ฐ’์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ณด๊ธฐ ํž˜๋“ค๊ฒŒ ๋˜์–ด์žˆ๊ธด ํ•œ๋ฐ.. ๊ฐ ..

[matplotlib] matplotlib.pyplot์„ ์ด์šฉํ•œ ์ด๋ฏธ์ง€ ์‹œ๊ฐํ™” ์ด์ •๋ฆฌ

0Install pip install matplotlib Import import matplotlib.pyplot as plt * ๋ฒ„์ „ ํ™•์ธ import matplotlib print(matplotlib.__version__) plot image #load image import cv2 img = cv2.imread('dog.jpg') img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #show iage plt.imshow(img) figure ํฌ๊ธฐ ์กฐ์ ˆ plt.figure(figsize=(15, 15)) plt.imshow(img) colorbar ํ‘œ์‹œ plt.imshow(img[...,0]) #๋งˆ์ง€๋ง‰ ์ฑ„๋„๋งŒ ํ‘œ์‹œ plt.colorbar() * Colorbar ์œ„์น˜ ์ด๋™ (v..

[h5py] hdf5 ์†Œ๊ฐœ, h5py ์‚ฌ์šฉ๋ฒ• ๊ฐ„๋‹จ ์ •๋ฆฌ

Manual: https://docs.h5py.org/en/stable/ HDF5 for Python — h5py 3.5.0 documentation © Copyright 2014, Andrew Collette and contributors Revision fb9989a7. docs.h5py.org h5py๋Š” HDF5 ๋ฐ์ดํ„ฐ ํฌ๋งท์„ Python์œผ๋กœ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋Š” ํŒจํ‚ค์ง€์ด๋‹ค. HDF5๋ฅผ ์ด์šฉํ•˜๋ฉด ๋Œ€๋Ÿ‰์˜ NumPy ๋ฐ์ดํ„ฐ ๋“ฑ์„ ์†์‰ฝ๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. About HDF5 HDF๋Š” Hierarchical Data Format์˜ ์•ฝ์ž์ด๋‹ค. HDF5์˜ ๋ชจ๋“  object๋Š” ๊ฐ์ž์˜ 'name'์ด ์žˆ๊ณ , ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ณ„์ธต์ ์ธ ๊ตฌ์กฐ๋กœ ๊ด€๋ฆฌ๋œ๋‹ค. ์ผ๋ฐ˜์ ์ธ ์šด์˜์ฒด์ œ์˜ ํŒŒ์ผ์‹œ์Šคํ…œ์„ ์ƒ๊ฐํ•˜๋ฉด ๋œ๋‹ค. ํด๋”์™€ ํŒŒ์ผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๋Š”..

๋ฐ˜์‘ํ˜•