Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from trainer import train | |
# Import ConfigSpace and different types of parameters | |
from smac.configspace import ConfigurationSpace, Configuration | |
from ConfigSpace.hyperparameters import CategoricalHyperparameter, \ | |
UniformFloatHyperparameter, UniformIntegerHyperparameter | |
from ConfigSpace.conditions import InCondition | |
# Import SMAC-utilities | |
from smac.tae.execute_func import ExecuteTAFuncDict | |
from smac.scenario.scenario import Scenario |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def attn_readout_v3(readout, attn_window, attn_heads, page_features, seed): | |
# input: [n_days, batch, readout_depth] | |
# [n_days, batch, readout_depth] -> [batch(readout_depth), width=n_days, channels=batch] | |
readout = tf.transpose(readout, [2, 0, 1]) | |
# [batch(readout_depth), width, channels] -> [batch, height=1, width, channels] | |
inp = readout[:, tf.newaxis, :, :] | |
# attn_window = train_window - predict_window + 1 | |
# [batch, attn_window * n_heads] | |
filter_logits = tf.layers.dense(page_features, attn_window * attn_heads, name="attn_focus", kernel_initializer=default_init(seed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object getOrCreate(String key, Object newValue) { | |
Object result = map.get(key); | |
if (result == null) { | |
map.put(key, newValue); | |
result = newValue; | |
} | |
return result; | |
} |