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.
This commit is contained in:
Fangjun Kuang 2021-11-26 11:25:59 +08:00 committed by GitHub
parent 00e2f0ade8
commit 0e541f5b5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -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(),
}

View File

@ -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()),
}