MCPcopy Create free account
hub / github.com/COLA-Laboratory/TransOPT / __init__

Method __init__

transopt/optimizer/model/deepkernel.py:100–123  ·  view source on GitHub ↗
(self, config = {})

Source from the content-addressed store, hash-verified

98@model_registry.register("DeepKernelGP")
99class DeepKernelGP(nn.Module):
100 def __init__(self, config = {}):
101 super(DeepKernelGP, self).__init__()
102
103 if len(config) == 0:
104 self.config = {"kernel": "matern", 'ard': False, "nu": 2.5, 'hidden_size': [32,32,32,32], 'n_inner_steps': 1,
105 'test_batch_size':1, 'batch_size':1, 'seed':0, 'eval_batch_size':1000, 'verbose':True, 'loss_tol':0.0001,
106 'max_patience':16, 'lr':0.001, 'epochs':100, 'load_model': False, 'checkpoint_path': './external/model/FSBO/Seed_0_1'}
107 else:
108 self.config = config
109 torch.manual_seed(self.config['seed'])
110
111 self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
112 self.hidden_size = self.config['hidden_size']
113 self.kernel_config = {"kernel": self.config['kernel'], "ard": self.config['ard'], "nu": self.config['nu']}
114 self.max_patience = self.config['max_patience']
115 self.lr = self.config['lr']
116 self.load_model = self.config['load_model']
117 self.checkpoint = self.config['checkpoint_path']
118
119 self.epochs = self.config['epochs']
120 self.verbose = self.config['verbose']
121 self.loss_tol = self.config['loss_tol']
122 self.eval_batch_size = self.config['eval_batch_size']
123 self.has_model = False
124
125
126 def get_model_likelihood_mll(self, train_size):

Callers

nothing calls this directly

Calls 2

deviceMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected