def erase_all_knowledge(self): # snb self.snb = SensoryNeuralBlock() self.snb.save("persistent_memory/sight_snb.p", "persistent_memory/hearing_snb.p") # Relational Neural Block self.rnb = RelNetwork(100) RelNetwork.serialize(self.rnb, "persistent_memory/rnb.p") # Addition by memory network self.am_net = CulturalNetwork(100) CulturalNetwork.serialize(self.am_net, "persistent_memory/am_net.p") # Syllables net self.syllables_net = CulturalNetwork(100) CulturalNetwork.serialize(self.syllables_net, "persistent_memory/syllables_net.p") # Words net self.words_net = CulturalNetwork(100) CulturalNetwork.serialize(self.words_net, "persistent_memory/words_net.p") # Sight-Syllables rel network self.ss_rnb = RelNetwork(100) RelNetwork.serialize(self.ss_rnb, "persistent_memory/ss_rnb.p") # Geometric Neural Block self.gnb = GeometricNeuralBlock() GeometricNeuralBlock.serialize(self.gnb, "persistent_memory/gnb.p") ################ INTENTIONS #################################################################################### self.episodic_memory = EpisodicMemoriesBlock() EpisodicMemoriesBlock.serialize(self.episodic_memory, "persistent_memory/episodic_memory.p") self.decisions_block = DecisionsBlock() DecisionsBlock.serialize(self.decisions_block, "persistent_memory/decisions_block.p") self.internal_state = InternalState() InternalState.serialize(self.internal_state, "persistent_memory/internal_state.p") self.desired_state = InternalState([0.5,1,1]) InternalState.serialize(self.desired_state, "persistent_memory/desired_state.p")
def set_internal_state(self, states_vector ): state_correctly_set = self.internal_state.set_state(states_vector) if state_correctly_set: self.decisions_block.set_internal_state(self.internal_state.get_state()) InternalState.serialize(self.internal_state, "persistent_memory/internal_state.p") return state_correctly_set
def set_desired_state(self, states_vector): state_correctly_set = self.desired_state.set_state(states_vector) if state_correctly_set: self.decisions_block.set_desired_state( self.desired_state.get_state()) InternalState.serialize(self.desired_state, "desired_state", self.project_id) return state_correctly_set
def feed_internal_state(self, states_vector): state_correctly_fed = self.internal_state.average_state(states_vector) if state_correctly_fed: self.decisions_block.set_internal_state( self.internal_state.get_state()) InternalState.serialize(self.internal_state, "internal_state", self.project_id) return state_correctly_fed
def create_kernel(self): # snb self.snb = SensoryNeuralBlock("no_data", "no_data", self.project_id) self.snb.save("snb_s", "snb_h", self.project_id, self.brain) # Relational Neural Block self.rnb = RelNetwork(100) RelNetwork.serialize(self.rnb, "rnb", self.project_id) # Addition by memory network self.am_net = CulturalNetwork(100) CulturalNetwork.serialize(self.am_net, "am_net", self.project_id) # Syllables net self.syllables_net = CulturalNetwork(100) CulturalNetwork.serialize(self.syllables_net, "syllables_net", self.project_id) # Words net self.words_net = CulturalNetwork(100) CulturalNetwork.serialize(self.words_net, "words_net", self.project_id) # Sight-Syllables rel network self.ss_rnb = RelNetwork(100) RelNetwork.serialize(self.ss_rnb, "ss_rnb", self.project_id) # Geometric Neural Block self.gnb = GeometricNeuralBlock() GeometricNeuralBlock.serialize(self.gnb, "gnb", self.project_id) ################ INTENTIONS #################################################################################### self.episodic_memory = EpisodicMemoriesBlock() EpisodicMemoriesBlock.serialize(self.episodic_memory, "episodic_memory", self.project_id) self.decisions_block = DecisionsBlock() DecisionsBlock.serialize(self.decisions_block, "decisions_block", self.project_id) self.internal_state = InternalState() InternalState.serialize(self.internal_state, "internal_state", self.project_id) self.desired_state = InternalState([0.75, 0.75, 0.75]) InternalState.serialize(self.desired_state, "desired_state", self.project_id)