DIR_DEPTH = 3 for _ in range(DIR_DEPTH + 1): ROOT = os.path.dirname(ROOT) sys.path.insert(0, ROOT) from tframe import console, SaveMode from tframe.trainers import SmartTrainerHub from tframe import Classifier import mn_du as du from_root = lambda path: os.path.join(ROOT, path) # ----------------------------------------------------------------------------- # Initialize config and set data/job dir # ----------------------------------------------------------------------------- th = SmartTrainerHub(as_global=True) th.data_dir = from_root('tframe/examples/00-MNIST/data/') th.job_dir = from_root('tframe/examples/00-MNIST') # ----------------------------------------------------------------------------- # Device configurations # ----------------------------------------------------------------------------- th.allow_growth = False th.gpu_memory_fraction = 0.30 # ----------------------------------------------------------------------------- # Set information about the data set # ----------------------------------------------------------------------------- th.input_shape = [28, 28, 1] th.num_classes = 10
sys.path.insert(0, ROOT) import numpy as np import tensorflow.compat.v1 as tf tf.disable_v2_behavior() from tframe import console, SaveMode from tframe import Classifier from tframe.trainers import SmartTrainerHub as Config import fi_du as du from_root = lambda path: os.path.join(ROOT, path) # ----------------------------------------------------------------------------- # Initialize config and set data/job dir # ----------------------------------------------------------------------------- th = Config(as_global=True) th.data_dir = from_root("FILOB/data/") th.job_dir = from_root("FILOB") # ----------------------------------------------------------------------------- # Device configurations # ----------------------------------------------------------------------------- th.allow_growth = False th.gpu_memory_fraction = 0.3 # ----------------------------------------------------------------------------- # Set information about the data set # ----------------------------------------------------------------------------- th.max_level = 10 th.volume_only = True th.developer_code = "use_log"
for _ in range(DIR_DEPTH + 1): ROOT = os.path.dirname(ROOT) sys.path.insert(0, ROOT) # Do some importing from tframe import console, SaveMode from tframe.trainers import SmartTrainerHub from tframe import Classifier import cf10_du as du from_root = lambda path: os.path.join(ROOT, path) # ----------------------------------------------------------------------------- # Initialize config and set data/job dir # ----------------------------------------------------------------------------- th = SmartTrainerHub(as_global=True) th.data_dir = from_root('tframe/examples/01-CIFAR10/data/') th.job_dir = from_root('tframe/examples/01-CIFAR10') # ----------------------------------------------------------------------------- # Device configurations # ----------------------------------------------------------------------------- th.allow_growth = False th.gpu_memory_fraction = 0.30 # ----------------------------------------------------------------------------- # Set information about the data set # ----------------------------------------------------------------------------- th.input_shape = [32, 32, 3] th.num_classes = 10 # ----------------------------------------------------------------------------- # Set common trainer configs
ROOT = os.path.dirname(ROOT) sys.path.insert(0, ROOT) from tframe.utils.misc import mark_str from tframe.data.sequences.signals.signal import Signal from tframe import console, SaveMode from tframe.trainers import SmartTrainerHub from tframe import Classifier import data_utils as du from gpat import init_methods from gpat.gpat_bigdata import GPATBigData from gpat.gpat_signal_set import GPATSignalSet from_root = lambda path: os.path.join(ROOT, path) th = SmartTrainerHub(as_global=True) th.data_dir = from_root('99-GPAT/data') from_gpat = lambda path: os.path.join(from_root('99-GPAT'), path) # region : Paths data_root = th.data_dir from_data_root = lambda path: os.path.join(data_root, path) input_dir = from_data_root('input') output_dir = from_data_root('output') from_input = lambda path: os.path.join(input_dir, path) from_output = lambda path: os.path.join(output_dir, path) label_sheet_path = from_data_root('labels.csv') raw_train_data_path = from_input('raw_data/audio_train') raw_train_csv_path = from_input('train.csv')
ROOT = os.path.abspath(__file__) # Specify the directory depth with respect to the root of your project here # (The project root usually holds your data folder and has a depth of 0) DIR_DEPTH = 3 for _ in range(DIR_DEPTH + 1): ROOT = os.path.dirname(ROOT) sys.path.insert(0, ROOT) from tframe import console, SaveMode from tframe.trainers import SmartTrainerHub from data_utils import load_data, evaluate from tframe import Predictor from_root = lambda path: os.path.join(ROOT, path) th = SmartTrainerHub(as_global=True) th.data_dir = from_root('tframe/examples/whbm/data/') th.job_dir = from_root('tframe/examples/whbm') th.allow_growth = False th.gpu_memory_fraction = 0.4 th.save_mode = SaveMode.ON_RECORD th.warm_up_thres = 1 th.at_most_save_once_per_round = True th.early_stop = True th.patience = 10 def activate():
for _ in range(DIR_DEPTH + 1): ROOT = os.path.dirname(ROOT) sys.path.insert(0, ROOT) from tframe import console from tframe.models.sl.classifier import Classifier from tframe.enums import SaveMode from tframe.trainers import SmartTrainerHub as Config import pm_du as du from_root = lambda path: os.path.join(ROOT, path) # ----------------------------------------------------------------------------- # Initialize config and set data/job dir # ----------------------------------------------------------------------------- th = Config(as_global=True) th.data_dir = from_root('04-pMNIST/data') th.job_dir = from_root('04-pMNIST') # ----------------------------------------------------------------------------- # Some device configurations # ----------------------------------------------------------------------------- th.allow_growth = False th.gpu_memory_fraction = 0.3 # ----------------------------------------------------------------------------- # Set information about the data set # ----------------------------------------------------------------------------- th.input_shape = [1] th.output_dim = 10 th.permute = True
import sys, os ROOT = os.path.abspath(__file__) # Specify the directory depth with respect to the root of your project here # (The project root usually holds your data folder and has a depth of 0) DIR_DEPTH = 3 for _ in range(DIR_DEPTH + 1): ROOT = os.path.dirname(ROOT) sys.path.insert(0, ROOT) from tframe import console, SaveMode from tframe.trainers import SmartTrainerHub from data_utils import load_data from tframe import Classifier from_root = lambda path: os.path.join(ROOT, path) th = SmartTrainerHub(as_global=True) th.data_dir = from_root('tframe/examples/cifar-10/data/') th.job_dir = from_root('tframe/examples/cifar-10') th.input_shape = [32, 32, 3] th.num_classes = 10 th.allow_growth = False th.gpu_memory_fraction = 0.4 th.save_mode = SaveMode.ON_RECORD th.warm_up_thres = 1 th.at_most_save_once_per_round = False th.early_stop = True th.patience = 10
# (The project root usually holds your data folder and has a depth of 0) DIR_DEPTH = 1 for _ in range(DIR_DEPTH + 1): ROOT = os.path.dirname(ROOT) sys.path.insert(0, ROOT) from tframe import console, SaveMode from tframe.models.sl.classifier import Classifier from tframe.trainers import SmartTrainerHub import timit_du as du from_root = lambda path: os.path.join(ROOT, path) # ----------------------------------------------------------------------------- # Initialize config and set data/job dir # ----------------------------------------------------------------------------- th = SmartTrainerHub(as_global=True) th.data_dir = from_root('05-TIMIT/data') th.job_dir = from_root('05-TIMIT') # ----------------------------------------------------------------------------- # Some device configurations # ----------------------------------------------------------------------------- th.allow_growth = False th.gpu_memory_fraction = 0.3 # ----------------------------------------------------------------------------- # Set information about the data set # ----------------------------------------------------------------------------- th.input_shape = [13] th.output_dim = 25 th.last_only = True