Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hydraを使った設定ファイル管理とoptunaプラグインでのパラメータ探索
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ringa_hyj
December 31, 2024
Technology
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Hydraを使った設定ファイル管理とoptunaプラグインでのパラメータ探索
Ringa_hyj
December 31, 2024
More Decks by Ringa_hyj
See All by Ringa_hyj
DVCによるデータバージョン管理
ringa_hyj
0
400
deeplakeによる大規模データのバージョン管理と深層学習フレームワークとの接続
ringa_hyj
0
110
ClearMLで行うAIプロジェクトの管理(レポート,最適化,再現,デプロイ,オーケストレーション)
ringa_hyj
0
250
Catching up with the tidymodels.[Japan.R 2021 LT]
ringa_hyj
3
880
多次元尺度法MDS
ringa_hyj
0
390
因子分析(仮)
ringa_hyj
0
210
階層、非階層クラスタリング
ringa_hyj
0
160
tidymodels紹介「モデリング過程料理で表現できる説」
ringa_hyj
0
680
深層学習をつかった画像スタイル変換の話と今までの歴史
ringa_hyj
0
500
Other Decks in Technology
See All in Technology
水を運ぶ人としてのリーダーシップ
izumii19
4
1.1k
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
10
2.7k
どうして今サーバーサイドKotlinを選択したのか
nealle
0
140
データレイクの「見えない問題」を可視化する
sansantech
PRO
1
240
認証認可だけじゃない! ID管理の構成要素と ライフサイクルを意識しよう
ritou
1
310
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
1
1.9k
NDIAS CTF 2026 問題解説会資料
bata_24
0
130
きのこカンファレンス2026_肩書きを外したとき私は誰か
yamasatimi
1
100
“詰む”前に仕組みを作れ 〜技術の波に溺れないためのキャッチアップ術〜
takasyou
7
4.5k
自作お家AIエージェントスタックチャンFWで困っている所紹介
74th
0
160
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
190
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
110
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
620
Mobile First: as difficult as doing things right
swwweet
225
10k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Mind Mapping
helmedeiros
PRO
1
270
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
Automating Front-end Workflow
addyosmani
1370
210k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Deep Space Network (abreviated)
tonyrice
0
220
Transcript
紹介 1/3 HYDRAの目的は・・・ 複数ジョブの実行や複雑なアプリケーション開発の 設定管理の効率化のためのフレームワーク こんな経験はありませんか? • 複数の実験設定を試す際に、パラメータの管理が煩雑になってしまう • 設定ファイルの変更履歴が追えず、どの設定で良い結果が出たのか分からなくなる
• 本番環境と開発環境で異なる設定を使いたいが、切り替えが面倒 はじめに
紹介 2/3 from omegaconf import DictConfig, OmegaConf import hydra @hydra.main(version_base=None,
config_path=".",config_name="config") def my_app(cfg): print(OmegaConf.to_yaml(cfg)) if __name__ == "__main__": my_app() # config.yaml db: driver: mysql user: omry password: secret $ python my_app.py db: driver: mysql user: omry password: secret $ python my_app.py db.user=root db.password=1234 db: driver: mysql user: root password: 1234 • @hydra.main()のデコレータで関数を装飾 • パラメタはyamlファイルで指定 • コマンドライン上から上書きが可能 • 実行ログやパラメタが記録され参照が可能 実行結果 上書き実行の結果 パラメタの読込/追跡
紹介 3/3 • 定義した複数の値を切り替えながら実行することも可能(マルチラン) • hydra-optuna-sweeper等プラグインと組み合わせパラメタ探索も可能 # @package hydra.sweeper sampler:
_target_: optuna.samplers.TPESampler seed: 123 consider_prior: true prior_weight: 1.0 consider_magic_clip: true consider_endpoints: false n_startup_trials: 10 n_ei_candidates: 24 multivariate: false warn_independent_sampling: true _target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper direction: minimize storage: null study_name: sphere n_trials: 20 n_jobs: 1 max_failure_rate: 0.0 params: x: range(-5.5,5.5,step=0.5) y: choice(0,1,2,3) パラメタ探索/最適化 Hydraとoptunaによる最適パラメタの探索 x -5 5 y 0 1 2 3 0