๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋จธ์‹ ๋Ÿฌ๋‹, ๋”ฅ๋Ÿฌ๋‹/OCR8

tf.Example, tfrecord ๊ณต๋ถ€ ์ฝ์€ ์ž๋ฃŒ: https://www.tensorflow.org/tutorials/load_data/tf_records 2019. 8. 23.
TF Guide - Tensors ๊ณต๋ถ€ https://www.tensorflow.org/guide/tensors#shape TF๋Š” ํ…์„œ์™€ ๊ด€๋ จ๋œ ์—ฐ์‚ฐ์„ ์ •์˜ํ•˜๊ณ  ์‹คํ–‰ํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ์ด๋‹ค. ํ…์„œ๋Š” ๊ณ ์ฐจ์› ๋ฒกํ„ฐ/ํ–‰๋ ฌ์˜ ์ผ๋ฐ˜ํ™”๋œ ๊ฐœ๋…์ด๋‹ค. (ํ…์„œ๋Š” ๋‚ด๋ถ€์ ์œผ๋กœ base data type์˜ n์ฐจ์› ์–ด๋ ˆ์ด๋กœ ํ‘œํ˜„๋œ๋‹ค.) TF ํ”„๋กœ๊ทธ๋žจ์„ ์งœ๋ฉด์„œ ๊ณ„์† ์กฐ์ž‘ํ•˜๊ณ  ๋„˜๊ฒจ์•ผ ํ•  ๊ฐ์ฒด๊ฐ€ ๋ฐ”๋กœ tf.Tensor ์ธ๋ฐ, tf.Tensor๋Š” ๋ถ€๋ถ„์ ์œผ๋กœ ์ •์˜๋˜์—ˆ๋‹ค๊ฐ€ ๋งˆ์ง€๋ง‰์— ๊ฐ’์„ ์ƒ์„ฑํ•˜๋Š” ์—ฐ์‚ฐ์„ ๋งํ•œ๋‹ค. TF ํ”„๋กœ๊ทธ๋žจ์€ 1) ๋จผ์ € tf.Tensor์˜ ๊ทธ๋ž˜ํ”„๋ฅผ ๋นŒ๋”ฉํ•˜๊ณ  2) ์–ด๋–ป๊ฒŒ ๊ฐ ํ…์„œ๊ฐ€ ๋‹ค๋ฅธ ๊ฐ€๋Šฅํ•œ ํ…์„œ์— ๊ธฐ๋ฐ˜ํ•ด ์—ฐ์‚ฐ๋˜๋Š”์ง€ ๋””ํ…Œ์ผ๋งํ•˜๊ณ  3) ์ด ๊ทธ๋ž˜ํ”„์˜ ์ผ๋ถ€๋ฅผ ์‹คํ–‰ํ•ด ์›ํ•˜๋Š” ๊ฐ’์„ ์–ป๋Š”๋‹ค. tf.Tensor๋Š” ๋‘ ๊ฐ€์ง€ properties๋ฅผ ๊ฐ–๋Š”๋‹ค: a data type (.. 2019. 8. 19.
Multi-GPU Model์—์„œ h5(hdf5)๋ฅผ ๋กœ๋“œํ•˜์ง€ ๋ชปํ•˜๋Š” ๋ฌธ์ œ ๋ฌธ์ œ ๊ฐœ์š” Multi-GPU Model๋กœ ํ•™์Šต์‹œํ‚ค๊ณ  h5(hdf5)๋กœ ์ €์žฅํ•ด๋‘” ๋‹ค์Œ, ๋‚˜์ค‘์— ๋ถˆ๋Ÿฌ์˜ฌ ๋•Œ layers ์ˆ˜๊ฐ€ ๋งž์ง€ ์•Š๋‹ค๊ณ  ์—๋Ÿฌ๊ฐ€ ๋‚จ ์ด๋ฏธ ๋งŽ์ด ์•Œ๋ ค์ง„ ๋ฒ„๊ทธ ํ•ด๊ฒฐ์ฑ… ๊ฐœ์š” Multi-GPU Model๋กœ ํ•™์Šตํ•œ weight๋ฅผ (Multi-GPU๋กœ compileํ•˜์ง€ ์•Š์€) Base Model์— setํ•œ ๋‹ค์Œ h5(hdf5)๋กœ ์ €์žฅ Epoch๊ฐ€ ๋ชจ๋‘ ๋๋‚œ ๋‹ค์Œ model.save()๋Š” ๋Œ€๋žต ์•„๋ž˜์™€ ๊ฐ™์ด ํ•˜๋ฉด ๋˜์ง€๋งŒ... ... parallel_model, base_model = get_compiled_model(...) parallel_model.fit(...) base_model.set_weights(parallel_model.get_weights()) base_model.save(filepath).. 2019. 8. 13.
Variable Scope ๊ณต๋ถ€ ์ฝ์€ ์ž๋ฃŒ: https://tensorflowkorea.gitbooks.io/tensorflow-kr/content/g3doc/how_tos/variable_scope/ ์ฃผ์š” ํ•จ์ˆ˜ - tf.get_variable(, , ): ์ž…๋ ฅ๋œ ์ด๋ฆ„์˜ ๋ณ€์ˆ˜๋ฅผ ์ƒ์„ฑํ•˜๊ฑฐ๋‚˜ ๋ฐ˜ํ™˜ - tf.variable_scope(): tf.get_variable()์— ์ „๋‹ฌ๋œ ์ด๋ฆ„์˜ ๋„ค์ž„์ŠคํŽ˜์ด์Šค๋ฅผ ๊ด€๋ฆฌ (with์™€ ํ•จ๊ป˜ ์“ฐ์ž„) - tf.get_variable_scope(): ํ˜„์žฌ variable scope๋ฅผ ๋ฐ˜ํ™˜ tf.get_variable() - tf.Variable()์ฒ˜๋Ÿผ ์ง์ ‘ ๊ฐ’์„ ์ „๋‹ฌํ•˜์ง€ ์•Š๊ณ  Initializer๋ฅผ ์‚ฌ์šฉ tf.constant_initializer(value): ์ œ๊ณต๋œ ๊ฐ’์œผ๋กœ ๋ชจ๋“  ๊ฒƒ์„ ์ดˆ๊ธฐํ™” tf.random_u.. 2019. 8. 13.