Example #1
0
 def __init__(self):
     self.__layer = []
     self.__input_symbol = Variable(name='InputSymbol')
     self.__current_symbol = self.__input_symbol
     self.__current_output = None
     self.__current_weight = None
     self.__current_bias = None
     self.__variables = []
     self.__data = None
     self.__optimizer = None
     self.__loss = None
     self.__train_engine = Engine()
     self.__predict_engine = Engine()
Example #2
0
 def end_iteration(self):
     for layer_tuple in self.__batch_normalization_layer:
         layer_mean_symbol, layer_variance_symbol = layer_tuple[0].normalization_symbol()
         normalization_engine = Engine(layer_variance_symbol)
         normalization_engine.bind = self.network.engine.bind
         layer_tuple[2].append(normalization_engine.value())
         layer_tuple[1].append(normalization_engine.value_cache[layer_mean_symbol])
Example #3
0
 def __init__(self, symbol: Symbol = None, variables=None):
     self.__engine: Engine = None
     self.__variables = []
     self.__value_cache = {}
     self.__gradient_cache = {}
     self.__gradient_engines = {}
     self.__symbol_dependence_variables = {}
     self.set_engine(Engine(symbol, variables))
Example #4
0
 def __init__(self):
     self.epoch = None
     self.iteration = None
     self.epochs = None
     self.batch_size = None
     self.engine = Engine()
     self.__layer = []
     self.__input_symbol = Variable(name='InputSymbol')
     self.__current_symbol = self.__input_symbol
     self.__current_output = None
     self.__current_weight = None
     self.__current_bias = None
     self.__variables = []
     self.__data = None
     self.__optimizer = None
     self.__loss = None
     self.__predict_engine = Engine()
     self.__plugin = collections.OrderedDict()
     self.load_default_plugin()
Example #5
0
 def __init__(self,
              rate: float,
              decay: float,
              square_decay: float,
              consistent: bool = False):
     self.__rate = rate
     self.__decay = decay
     self.__square_decay = square_decay
     self.__consistent = consistent
     self.__gradient_engine = Engine()
     self.__estimation_map = {}
     self.__square_estimation_map = {}
     self.__step = 1
Example #6
0
 def __init__(self, rate: float, consistent: bool = False):
     self.__rate = rate
     self.__consistent = consistent
     self.__gradient_engine = Engine()
     self.__accumulate_gradient_map = {}
Example #7
0
 def __init__(self, rate: float, factor: float, consistent: bool = False):
     self.__rate = rate
     self.__factor = factor
     self.__consistent = consistent
     self.__old_gradient_map = {}
     self.__gradient_engine = Engine()
Example #8
0
 def __init__(self, rate: float, consistent: bool = False):
     self.__rate = rate
     self.__consistent = consistent
     self.__gradient_engine = Engine()
     self.__mean_map = {}
     self.__step = 1
Example #9
0
 def __init__(self, decay: float, consistent: bool = False):
     self.__decay = decay
     self.__consistent = consistent
     self.__gradient_engine = Engine()
     self.__accumulate_gradient_map = {}
     self.__expectation_map = {}
Example #10
0
 def maximize(self, engine: Engine):
     engine.differentiate()
     variables = engine.variables
     for variable in variables:
         variable.value += self.__rate * Engine(
             engine.gradient(variable)).value()
Example #11
0
 def __init__(self, rate: float):
     self.__rate = rate
     self.__gradient_engine = Engine()
Example #12
0
 def initialization(self):
     for symbol in self.__variables:
         gradient_symbol = self.__engine.gradient(symbol)
         self.__gradient_engines[symbol] = Engine(gradient_symbol)
         self.__symbol_dependence_variables[
             symbol] = gradient_symbol.dependenc(SymbolCategory.variable)