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 # ----------------------------------------------------------------------------- th.show_structure_detail = True
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 # ----------------------------------------------------------------------------- # Set common trainer configs
# (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(): assert callable(th.model) model = th.model(th)
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" th.input_shape = [20] th.num_classes = 3
# 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/mnist/data/') th.job_dir = from_root('tframe/examples/mnist') th.input_shape = [28, 28, 1] 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 def activate(export_false=False):
import numpy as np import tensorflow as tf 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('95-FI2010/data/') th.job_dir = from_root('95-FI2010') # ----------------------------------------------------------------------------- # 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' th.input_shape = [20] th.num_classes = 3
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 # ----------------------------------------------------------------------------- # Set common trainer configs
# 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 use_bn = False
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 # ----------------------------------------------------------------------------- # Set common model configs