Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EC-KitY/DNC

Repository files navigation

Deep Neural Crossover (DNC)

This repository implements the Deep Neural Crossover (DNC) operator as described in the paper:
"Deep Neural Crossover: A Multi-Parent Operator That Leverages Gene Correlations"
ACM Link alt text


🚀 Quick Start

To run a full example using the DNC operator on the Bin Packing Problem, execute:

python dnc_runner_eckity.py

This example uses:

  • Integer vector representation of solutions.
  • A domain-specific fitness evaluator for bin packing.
  • Tournament selection, and n-point mutation.

📁 File Structure

  • dnc_runner_eckity.py - Main script running the evolutionary algorithm with the DNC operator.
  • datasets/hard_parsed.json - A JSON file containing bin packing datasets used in the paper.
  • Custom components:
    • BinPackingEvaluator - Evaluates fitness based on bin packing constraints.

Customization Guide

To use this code for a different problem domain, only a few parts need to be modified:

1. Define a Custom Evaluator

Replace BinPackingEvaluator with a custom class that inherits from SimpleIndividualEvaluator:

class YourEvaluator(SimpleIndividualEvaluator):
    def evaluate_individual(self, individual):
        # return a float indicating fitness
        return your_fitness_function(individual.vector)

2. Update the Creator (if needed)

If you need special initialization, adjust GAIntegerStringVectorCreator.

3. Configure DNC

The DNC operator requires setting the correct number of embedding dimensions, which should correspond to the number of distinct values each gene can take (i.e., the number of bins, colors, etc.).

DeepNeuralCrossoverConfig(
    gene_value_dim=MAX_GENE_VALUE + 1,
    embedding_dim=EMBED_DIM,  # e.g., 64
    ...
)

⚙️ Evolutionary Parameters

You can easily adjust standard evolutionary settings:

population_size = 100
crossover_rate = 0.5
mutation_rate = 0.1
num_generations = 6000

These are passed to the Subpopulation and SimpleEvolution constructors.


About

A Deep Neural Crossover Plugin for ECKity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages