-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
37 lines (27 loc) · 863 Bytes
/
setup.py
File metadata and controls
37 lines (27 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import sys
import numpy as np
import tensorflow as tf
import keras
if __name__ == "__main__":
def is_google_colab():
"""Check if the environment is Google Colab."""
try:
import google.colab
return True
except ImportError:
return False
BASE_PATH = os.getcwd()
if is_google_colab():
from google.colab import drive
BASE_PATH = os.path.join(BASE_PATH, "drive")
drive.mount(BASE_PATH)
DIR_PATH = os.path.join(BASE_PATH, "MyDrive", "da-svd")
sys.path.append(DIR_PATH)
else:
DIR_PATH = os.path.join(BASE_PATH, "da-svd")
sys.path.append(DIR_PATH)
from util.constants import SEED, PATHS
np.random.seed(SEED)
tf.random.set_seed(SEED)
keras.utils.set_random_seed(SEED)