This commit is contained in:
D-X-Y
2019-11-08 20:06:12 +11:00
parent 5e44189d7e
commit 1da5b49018
9 changed files with 256 additions and 2 deletions

View File

@@ -2,3 +2,4 @@ from .search_model_darts_v1 import TinyNetworkDartsV1
from .search_model_darts_v2 import TinyNetworkDartsV2
from .search_model_gdas import TinyNetworkGDAS
from .search_model_setn import TinyNetworkSETN
from .genotypes import Structure as CellStructure, architectures as CellArchitectures

View File

@@ -60,6 +60,13 @@ class Structure:
strings.append( string )
return '+'.join(strings)
def check_valid_op(self, op_names):
for node_info in self.nodes:
for inode_edge in node_info:
#assert inode_edge[0] in op_names, 'invalid op-name : {:}'.format(inode_edge[0])
if inode_edge[0] not in op_names: return False
return True
def __repr__(self):
return ('{name}({node_num} nodes with {node_info})'.format(name=self.__class__.__name__, node_info=self.tostr(), **self.__dict__))