aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2022-03-17 20:10:42 +0800
committerJordan Gong <jordan.gong@protonmail.com>2022-03-17 20:10:42 +0800
commit9b2c25d3c927b7533e5d7d9665b67962e4c6934b (patch)
treeb4a80004ffdfe8165f5f8d077afb8b054d4472ce
parent568569c764ffdd73cd660434df50d30d26203f63 (diff)
Move some utils to libs directory
-rw-r--r--.idea/contrastive-learning.iml7
-rw-r--r--libs/datautils.py (renamed from supervised/datautils.py)0
-rw-r--r--libs/optimizers.py (renamed from supervised/optimizers.py)0
-rw-r--r--libs/schedulers.py (renamed from supervised/schedulers.py)0
-rw-r--r--libs/utils.py (renamed from supervised/utils.py)0
-rw-r--r--supervised/baseline.py14
6 files changed, 17 insertions, 4 deletions
diff --git a/.idea/contrastive-learning.iml b/.idea/contrastive-learning.iml
index af873e6..728ebac 100644
--- a/.idea/contrastive-learning.iml
+++ b/.idea/contrastive-learning.iml
@@ -12,4 +12,11 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Python 3.10 interpreter library" level="application" />
</component>
+ <component name="PyNamespacePackagesService">
+ <option name="namespacePackageFolders">
+ <list>
+ <option value="$MODULE_DIR$/supervised" />
+ </list>
+ </option>
+ </component>
</module> \ No newline at end of file
diff --git a/supervised/datautils.py b/libs/datautils.py
index 843f669..843f669 100644
--- a/supervised/datautils.py
+++ b/libs/datautils.py
diff --git a/supervised/optimizers.py b/libs/optimizers.py
index 1904e8d..1904e8d 100644
--- a/supervised/optimizers.py
+++ b/libs/optimizers.py
diff --git a/supervised/schedulers.py b/libs/schedulers.py
index 7580bf3..7580bf3 100644
--- a/supervised/schedulers.py
+++ b/libs/schedulers.py
diff --git a/supervised/utils.py b/libs/utils.py
index fde86eb..fde86eb 100644
--- a/supervised/utils.py
+++ b/libs/utils.py
diff --git a/supervised/baseline.py b/supervised/baseline.py
index 221b90d..15bb716 100644
--- a/supervised/baseline.py
+++ b/supervised/baseline.py
@@ -1,3 +1,9 @@
+import sys
+from pathlib import Path
+
+path = str(Path(Path(__file__).parent.absolute()).parent.absolute())
+sys.path.insert(0, path)
+
import argparse
import os
import random
@@ -11,11 +17,11 @@ from torch.utils.tensorboard import SummaryWriter
from torchvision.datasets import CIFAR10, ImageNet
from torchvision.transforms import transforms, InterpolationMode
-from datautils import color_distortion, Clip, RandomGaussianBlur
+from libs.datautils import color_distortion, Clip, RandomGaussianBlur
+from libs.optimizers import LARS
+from libs.schedulers import LinearWarmupAndCosineAnneal, LinearLR
+from libs.utils import training_log, setup_logging, EPOCH_LOGGER, BATCH_LOGGER
from models import CIFARResNet50, ImageNetResNet50
-from optimizers import LARS
-from schedulers import LinearWarmupAndCosineAnneal, LinearLR
-from utils import training_log, setup_logging, EPOCH_LOGGER, BATCH_LOGGER
def build_parser():