From 0e541f5b5db8f32d675621d3bcc63aa15304944b Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 26 Nov 2021 11:25:59 +0800 Subject: [PATCH] Print hostname and IP address to the log. (#131) We are using multiple machines to do various experiments. It makes life easier to know which experiment is running on which machine if we also log the IP and hostname of the machine. --- egs/librispeech/ASR/conformer_ctc/train.py | 10 +++++++--- icefall/env.py | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc/train.py b/egs/librispeech/ASR/conformer_ctc/train.py index c6063fade..ec9b0b7c2 100755 --- a/egs/librispeech/ASR/conformer_ctc/train.py +++ b/egs/librispeech/ASR/conformer_ctc/train.py @@ -124,6 +124,13 @@ def get_parser(): """, ) + parser.add_argument( + "--lr-factor", + type=float, + default=5.0, + help="The lr_factor for Noam optimizer", + ) + return parser @@ -182,8 +189,6 @@ def get_params() -> AttributeDict: - weight_decay: The weight_decay for the optimizer. - - lr_factor: The lr_factor for Noam optimizer. - - warm_step: The warm_step for Noam optimizer. """ params = AttributeDict( @@ -209,7 +214,6 @@ def get_params() -> AttributeDict: "use_double_scores": True, # parameters for Noam "weight_decay": 1e-6, - "lr_factor": 5.0, "warm_step": 80000, "env_info": get_env_info(), } diff --git a/icefall/env.py b/icefall/env.py index fd56ad8c2..0684c4bf1 100644 --- a/icefall/env.py +++ b/icefall/env.py @@ -16,6 +16,7 @@ # limitations under the License. +import socket import subprocess import sys from pathlib import Path @@ -103,4 +104,6 @@ def get_env_info() -> Dict[str, Any]: "icefall-path": str(Path(__file__).resolve().parent.parent), "k2-path": str(Path(k2.__file__).resolve()), "lhotse-path": str(Path(lhotse.__file__).resolve()), + "hostname": socket.gethostname(), + "IP address": socket.gethostbyname(socket.gethostname()), }