MCPcopy Index your code
hub / github.com/geekcomputers/Python / crossover

Method crossover

ML/src/python/neuralforge/nas/search_space.py:145–151  ·  view source on GitHub ↗
(self, parent1: Architecture, parent2: Architecture)

Source from the content-addressed store, hash-verified

143 return Architecture(new_genome)
144
145 def crossover(self, parent1: Architecture, parent2: Architecture) -> Architecture:
146 min_len = min(len(parent1.genome), len(parent2.genome))
147 crossover_point = random.randint(1, min_len - 1)
148
149 child_genome = parent1.genome[:crossover_point] + parent2.genome[crossover_point:]
150
151 return Architecture(child_genome)
152
153 def estimate_complexity(self, architecture: Architecture, input_size: int = 224) -> Dict[str, float]:
154 total_params = 0

Callers 1

create_offspringMethod · 0.80

Calls 1

ArchitectureClass · 0.85

Tested by

no test coverage detected