8000 Readd regularization loss for classification by gomezzz · Pull Request #8 · esa/NIDN · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Readd regularization loss for classification #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 23, 2021
20 changes: 16 additions & 4 deletions nidn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import os

# Set main device by default to cpu if no other choice was made before
if "TORCH_DEVICE" not in os.environ:
os.environ["TORCH_DEVICE"] = "cpu"
import torch
from loguru import logger

# Add exposed features here
from .plots.plot_model_grid import plot_model_grid
Expand All @@ -15,6 +13,19 @@
from .utils.fix_random_seeds import fix_random_seeds
from .utils.load_default_cfg import load_default_cfg
from .utils.print_cfg import print_cfg
from .utils.set_log_level import set_log_level

set_log_level("INFO")

# Set main device by default to cpu if no other choice was made before
if "TORCH_DEVICE" not in os.environ:
os.environ["TORCH_DEVICE"] = "cpu"

logger.info(f"Initialized NIDN for {os.environ['TORCH_DEVICE']}")

# Set precision (and potentially GPU)
torch.set_default_tensor_type(torch.DoubleTensor)
logger.info("Using double precision")

__all__ = [
"compute_target_frequencies",
Expand All @@ -28,5 +39,6 @@
"plot_model_grid_per_freq",
"plot_spectra",
"print_cfg",
"set_log_level",
"wl_to_phys_wl",
]
Empty file added nidn/materials/__init__.py
Empty file.
Loading
0