Esempio n. 1
0
 def __init__(self,
              sources,
              num_seq_per_batch,
              input_processing=None,
              target_processing=None,
              source_probabilities=None,
              rng_seed=None,
              dtype=np.float32):
     self.source_ids = {}
     self.source_names = []
     self.sources = []
     for source in sources:
         self.source_ids[source] = len(self.sources)
         self.sources.append(sources[source])
         self.source_names.append(source)
     #self.sources = np.array(self.sources)
     self.num_seq_per_batch = num_seq_per_batch
     self.input_processing = none_to_list(input_processing)
     self.target_processing = none_to_list(target_processing)
     num_sources = len(self.sources)
     if source_probabilities is None:
         self.source_probabilities = [1 / num_sources] * num_sources
     else:
         self.source_probabilities = source_probabilities
     self.rng_seed = rng_seed
     self.rng = np.random.RandomState(self.rng_seed)
     self._source_iterators = [None] * num_sources
     self.dtype = dtype
Esempio n. 2
0
 def __init__(self, sources, num_seq_per_batch,
              input_processing=None,
              target_processing=None,
              source_probabilities=None,
              rng_seed=None):
     self.sources = sources
     self.num_seq_per_batch = num_seq_per_batch
     self.input_processing = none_to_list(input_processing)
     self.target_processing = none_to_list(target_processing)
     num_sources = len(self.sources)
     if source_probabilities is None:
         self.source_probabilities = [1 / num_sources] * num_sources
     else:
         self.source_probabilities = source_probabilities
     self.rng_seed = rng_seed
     self.rng = np.random.RandomState(self.rng_seed)
     self._source_iterators = [None] * num_sources
Esempio n. 3
0
 def __init__(self, sources, num_seq_per_batch,
              input_processing=None,
              target_processing=None,
              source_probabilities=None,
              rng_seed=None):
     self.sources = sources
     self.num_seq_per_batch = num_seq_per_batch
     self.input_processing = none_to_list(input_processing)
     self.target_processing = none_to_list(target_processing)
     num_sources = len(self.sources)
     if source_probabilities is None:
         self.source_probabilities = [1 / num_sources] * num_sources
     else:
         self.source_probabilities = source_probabilities
     self.rng_seed = rng_seed
     self.rng = np.random.RandomState(self.rng_seed)
     self._source_iterators = [None] * num_sources
Esempio n. 4
0
 def __init__(self, output_layer, description="", tags=None,
              predecessor_experiment=""):
     self.layers = get_all_layers(output_layer)
     self._deterministic_output_func = None
     self.train_iterations = 0
     self.description = description
     self.tags = none_to_list(tags)
     for tag in self.tags:
         if tag not in VALID_TAGS:
             raise ValueError("{} is not a valid tag!".format(tag))
     self.predecessor_experiment = predecessor_experiment
Esempio n. 5
0
 def __init__(self,
              output_layer,
              description="",
              tags=None,
              predecessor_experiment=""):
     self.layers = get_all_layers(output_layer)
     self._deterministic_output_func = None
     self.train_iterations = 0
     self.description = description
     self.tags = none_to_list(tags)
     for tag in self.tags:
         if tag not in VALID_TAGS:
             raise ValueError("{} is not a valid tag!".format(tag))
     self.predecessor_experiment = predecessor_experiment