File tree Expand file tree Collapse file tree 5 files changed +10
-144
lines changed
crates/radiate-engines/src/steps Expand file tree Collapse file tree 5 files changed +10
-144
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ where
133133 return Some ( species_idx) ;
134134 }
135135 }
136+
136137 None
137138 } )
138139 . flatten ( ) ;
Original file line number Diff line number Diff line change @@ -311,24 +311,20 @@ You can implement your own behavioral descriptors by implementing the `Novelty`
311311 }
312312
313313 // Create novelty search fitness function
314- let novelty_fitness = NoveltySearch::new(
315- MyModelBehaviorDescriptor,
316- 10, // k: number of nearest neighbors
317- 0.1 // threshold: novelty threshold for archive addition
318- )
319- .with_archive_size(1000) // Optional: set archive size - default is 1000
320- .cosine_distance(); // Optional set the distance parameter used
321- // .euclidean_distance() // euclidean_distance is the default
322- // .hamming_distance()
314+ let novelty_fitness = NoveltySearch::new(MyModelBehaviorDescriptor)
315+ .k(10)
316+ .threshold(0.1)
317+ .with_archive_size(1000) // Optional: set archive size - default is 1000
318+ .cosine_distance(); // Optional set the distance parameter used
319+ // .euclidean_distance() // euclidean_distance is the default
320+ // .hamming_distance()
323321
324322 // Novelty is also implemented for any F where F: Fn(&T) -> Vec<f32>. Meaning, you can
325323 // just as easily feed a function to NoveltySearch as long as it takes a borrowed T (&T)
326324 // and returns a Vec<f32>
327325 let function_novelty_fitness = NoveltySearch::new(
328- |individual: &MyModel| // ... return a Vec<f32> that describes MyModel ...
329- 10,
330- 0.1
331- )
326+ |individual: &MyModel| // ... return a Vec<f32> that describes MyModel ...
327+ );
332328
333329 let engine = GeneticEngine::builder()
334330 // The decoded genotype from your codec (my_model_codec in this case) will be fed
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments