new architecture
This commit is contained in:
23
algorithm/neat/gene/base.py
Normal file
23
algorithm/neat/gene/base.py
Normal file
@@ -0,0 +1,23 @@
|
||||
class BaseGene:
|
||||
"Base class for node genes or connection genes."
|
||||
fixed_attrs = []
|
||||
custom_attrs = []
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def new_custom_attrs(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def mutate(self, randkey, gene):
|
||||
raise NotImplementedError
|
||||
|
||||
def distance(self, gene1, gene2):
|
||||
raise NotImplementedError
|
||||
|
||||
def forward(self, attrs, inputs):
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def length(self):
|
||||
return len(self.fixed_attrs) + len(self.custom_attrs)
|
||||
Reference in New Issue
Block a user