Linking attributes between classes

21 hours ago 3
ARTICLE AD BOX

I'm writing a program that creates neural networks. Each neural network will have 26 neurons corresponding to letters of the alphabet.

Right now, I'm stuck trying to create the first neuron of the first class. Once i get it to take the information from the Neural_Network class parameters to the Neuron class parameters, i can create multiple neural networks, each with its own set of pre-named neurons based on the attributes of the neural network it belongs to.

#Namecode for the main operation of the lobes and the main data stream Main = "MAIN" Main_Stream = "STRM" Frontal = "FRNT" Parietal = "PART" Temporal = "TEMP" Occipital = "OCCP" #Namecode for the operations of the Frontal lobe Problem_Solving = "ProbSolv" Judgement = "Judge" Personality = "Person" Emotions = "Emote" Speech = "Speech" Motor_Function = "MotoFunc" #Namecode for the operations of the Parietal lobe Sensory = "Sense" Spatial_Awareness = "SpatAware" #Visual_Perception = "VisPercep" Academic_Skills = "AcadSkill" Math_Calculation = "MathCalc" Reading_Writing = "ReadWrite" #Namecode for the operations of the Temporal lobe Language_Comprehension = "LangComp" Organization_Sequence = "OrgSeq" Information_Retrieval = "InfoRet" Musical_Awareness = "MusicAware" Memory = "Mem" Hearing = "Hear" Learning = "Learn" Feeling = "Feel" #Namecode for the operations of the Occipital lobe Visual_Perception = "VisPercep" Visual_Interpretation = "VisInter" Reading = "Read" #Namecode for the layers of each Operation Observation = "OBS" Analyzation = "AN" Hypothesis = "HYP" Execution = "EXEC" Analyze_Results = "ANRES" Record_Results = "REC" def main(): class Neural_Network: def __init__(self, name, lobe, operation, layer): self.name = name self.lobe = lobe self.operation = operation self.layer = layer def show_Network_info(self): print(f"{self.lobe}_{self.operation}_{self.layer}") class Neuron: pass def __init__(self, name, lobe, operation, layer): self.name = name self.lobe = lobe self.operation = operation self.layer = layer def show_Neuron_info(self): print(f"{self.name}_{self.lobe}_{self.operation}_{self.layer}") Neuron_A = Neuron(f"{self.name}_A", self.lobe, self.operation, self.layer) FRNT_ProbSolv_OBS = Neural_Network("FRNT_ProbSolv_OBS", Frontal, Problem_Solving, Observation) FRNT_ProbSolv_OBS.show_Network_info()
Read Entire Article