Ejemplo n.º 1
0
    def __init__(self):
        self.logger = utils.get_logger('Learner')
        self._embedding_layer_name = 'embedding'

        self.__monitor = 'val_acc'
        self.__weights_name = 'weights.h5'
        self.__architecture_name = 'architecture.json'
        self.__model_graph_name = 'structure.png'

        self.model = self.setup()
Ejemplo n.º 2
0
    def __init__(self, name, special_instances=(), keep_growing=True):
        self.__name = name

        self.__instance2index = {}
        self.__instances = []
        self.__keep_growing = keep_growing

        # Index 0 is occupied by default, all else following.
        self.__next_index = 1

        for instance in special_instances:
            self.add(instance)

        self.logger = utils.get_logger('Alphabet')
Ejemplo n.º 3
0
    def __init__(self, graph_mode=True):
        self.logger = utils.get_logger('Learner')
        self._embedding_layer_name = 'embedding'
        self._main_input_layer_name = 'input'
        self._main_output_layer_name = "prediction_output"
        self._graph_mode = graph_mode

        self.model = self._get_model()

        self.__monitor = 'val_acc'
        self.__weights_name = 'weights.h5'
        self.__architecture_name = 'architecture.json'
        self.__model_graph_name = 'structure.png'

        self.setup()
Ejemplo n.º 4
0
    def __init__(self, name, special_instances=(), keep_growing=True):
        self.__name = name

        self.__instance2index = {}
        self.__instances = []
        self.__keep_growing = keep_growing

        # Index 0 is occupied by default, all else following.
        self.default_index = 0
        self.__next_index = 1

        for instance in special_instances:
            self.add(instance)

        self.logger = utils.get_logger('Alphabet')
Ejemplo n.º 5
0
"""
A base learner that does not have any architecture. Implementations need to fill that part in.
"""

import numpy as np
from keras.callbacks import EarlyStopping
from keras.models import model_from_json
import os
from finest.utils.callbacks import MonitorLoss
import finest.utils.utils as utils
from keras.utils.visualize_util import plot

from finest.utils.configs import ExperimentConfig

logger = utils.get_logger(__name__)


class BaseLearner(object):
    def __init__(self):
        self.logger = utils.get_logger('Learner')
        self._embedding_layer_name = 'embedding'

        self.__monitor = 'val_acc'
        self.__weights_name = 'weights.h5'
        self.__architecture_name = 'architecture.json'
        self.__model_graph_name = 'structure.png'

        self.model = self.setup()

    def setup(self):
        pass
Ejemplo n.º 6
0
"""
A base learner that does not have any architecture. Implementations need to fill that part in.
"""

import numpy as np
from keras.callbacks import EarlyStopping
from keras.models import model_from_json
from keras.models import Sequential, Graph
import os
from finest.utils.callbacks import MonitorLoss
import finest.utils.utils as utils
from keras.utils.visualize_util import plot
import json

logger = utils.get_logger(__name__)


class BaseLearner(object):
    def __init__(self, graph_mode=True):
        self.logger = utils.get_logger('Learner')
        self._embedding_layer_name = 'embedding'
        self._main_input_layer_name = 'input'
        self._main_output_layer_name = "prediction_output"
        self._graph_mode = graph_mode

        self.model = self._get_model()

        self.__monitor = 'val_acc'
        self.__weights_name = 'weights.h5'
        self.__architecture_name = 'architecture.json'
        self.__model_graph_name = 'structure.png'