Skip to content

Commit a901c10

Browse files
committed
Update examples to use candle_lib.
1 parent 4434374 commit a901c10

16 files changed

+3
-78
lines changed

examples/ADRP/adrp.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import print_function
22

33
import os
4-
import sys
54
import logging
65

76
import pandas as pd
@@ -12,10 +11,6 @@
1211
from sklearn.preprocessing import StandardScaler
1312

1413
file_path = os.path.dirname(os.path.realpath(__file__))
15-
# lib_path = os.path.abspath(os.path.join(file_path, '..'))
16-
# sys.path.append(lib_path)
17-
lib_path2 = os.path.abspath(os.path.join(file_path, "..", "..", "common"))
18-
sys.path.append(lib_path2)
1914

2015
import candle
2116

examples/ADRP/reg_go2.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pandas as pd
22
import numpy as np
33
import os
4-
import sys
54
import argparse
65

76
import math
@@ -19,13 +18,10 @@
1918

2019
from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger, ReduceLROnPlateau, EarlyStopping
2120

22-
2321
from sklearn.model_selection import train_test_split
2422
from sklearn.preprocessing import StandardScaler
2523

2624
file_path = os.path.dirname(os.path.realpath(__file__))
27-
lib_path = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
28-
sys.path.append(lib_path)
2925

3026
psr = argparse.ArgumentParser(description='input csv file')
3127
psr.add_argument('--in', default='in_file')

examples/M16/M16_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import os
2-
import sys
32
import pandas as pd
43
import numpy as np
54
import warnings
65
warnings.filterwarnings("ignore")
76

87
file_path = os.path.dirname(os.path.realpath(__file__))
9-
lib_path2 = os.path.abspath(os.path.join(file_path, "..", "..", "common"))
10-
sys.path.append(lib_path2)
118

129
import candle
1310

examples/histogen/extract_code_baseline_pytorch.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
from vqvae import VQVAE
1414

1515
file_path = os.path.dirname(os.path.realpath(__file__))
16-
lib_path = os.path.abspath(os.path.join(file_path, '..'))
17-
sys.path.append(lib_path)
18-
lib_path2 = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
19-
sys.path.append(lib_path2)
20-
2116

2217
import candle
2318

examples/histogen/sample_baseline_pytorch.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import sys
32

43
import torch
54
from torchvision.utils import save_image
@@ -9,11 +8,6 @@
98
from pixelsnail import PixelSNAIL
109

1110
file_path = os.path.dirname(os.path.realpath(__file__))
12-
lib_path = os.path.abspath(os.path.join(file_path, '..'))
13-
sys.path.append(lib_path)
14-
lib_path2 = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
15-
sys.path.append(lib_path2)
16-
1711

1812
import candle
1913

examples/histogen/train_pixelsnail_baseline_pytorch.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
from scheduler import CycleScheduler
2020

2121
file_path = os.path.dirname(os.path.realpath(__file__))
22-
lib_path = os.path.abspath(os.path.join(file_path, '..'))
23-
sys.path.append(lib_path)
24-
lib_path2 = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
25-
sys.path.append(lib_path2)
26-
2722

2823
import candle
2924

examples/histogen/train_vqvae_baseline_pytorch.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616

1717

1818
file_path = os.path.dirname(os.path.realpath(__file__))
19-
lib_path = os.path.abspath(os.path.join(file_path, '..'))
20-
sys.path.append(lib_path)
21-
lib_path2 = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
22-
sys.path.append(lib_path2)
2319

2420
port = (2 ** 15 + 2 ** 14 + hash(os.getuid()
2521
if sys.platform != "win32" else 1) % 2 ** 14)

examples/image-vae/image_vae_baseline_pytorch.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
from model import GeneralVae, PictureDecoder, PictureEncoder, customLoss
1414
from utils import AverageMeter
1515
import os
16-
import sys
1716

1817
file_path = os.path.dirname(os.path.realpath(__file__))
19-
lib_path = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
20-
sys.path.append(lib_path)
2118

2219
import candle
2320

examples/image-vae/sample_baseline_pytorch.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import os
3-
import sys
43

54
import numpy as np
65
import torch
@@ -13,8 +12,6 @@
1312
logger.setLevel(logging.CRITICAL)
1413

1514
file_path = os.path.dirname(os.path.realpath(__file__))
16-
lib_path = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
17-
sys.path.append(lib_path)
1815

1916
import candle
2017

examples/mnist/mnist.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import os
2-
import sys
32
file_path = os.path.dirname(os.path.realpath(__file__))
4-
lib_path = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
5-
sys.path.append(lib_path)
63

74
from tensorflow.keras import backend as K
85
import candle

0 commit comments

Comments
 (0)