Get Started with Gadget

Welcome to the Gadget App Homepage 🚀

Ready to dive into optimizing your solutions? Start by clicking here to access the Gadget App Homepage, where you’ll find insightful statistics based on your submissions and their results.

👉 Pro Tip: Make sure you’re logged in with your Gadget account to unlock all the features!

The left sidebar is your control center, offering the following options:

  1. App Home: Return to the Gadget homepage anytime.

  2. Documentation: Access comprehensive guides and resources to help you navigate the app.

  3. New: Start fresh by creating a brand-new submission.

  4. Quick Start: Jump right in with one of our ready-to-use applications.

  5. User Submissions: View and manage all the submissions you’ve made.

  6. App Settings: Customize your Gadget experience.

Why Wait? Start Exploring Today! 🌟

Optimize smarter, not harder, with Gadget. Every submission is a step closer to better solutions!

Submissions

A submission in Gadget is a task executed by the app to optimize or solve a problem based on the parameters and code you provide. Whether you’re defining custom logic or leveraging pre-built solutions, submissions are the foundation of your work in Gadget.

Using Gadget, you can create submissions from scratch or use one of the pre-built applications to help you quickly create a submission.

For new submissions, you’ll need to provide essential code parameters, such as the fitness function. For a complete guide on supported parameters, check out the Parameters section.

The Gadget app settings allow you to save your submission code, enabling you to re-execute or continue the submission later without rewriting the code. When user-defined code or data is provided, it is securely executed in an isolated sandbox environment to ensure safety and privacy.

Pre-built applications, on the other hand, are ready-to-use solutions designed for fast implementation. You can optionally adjust parameters to suit your needs. For more details about these submissions, visit the Built-in Applications section.

New

To create a new submission, follow these steps:

  1. Open the Gadget app through this URL.

  2. In the left sidebar, click on the New option.

  3. Provide the mandatory parameters listed in the Mandatory section of the Parameters documentation.

  4. After entering the required parameters, go to the Done tab and click Submit to initiate the execution process.

When you use your own code, the submission is executed in a secure, isolated environment to ensure the safety and integrity of your data and code. You can control whether the code is saved into our database or not from the app settings.

Quick

To get started quickly by using one of the already built application, please follow these steps:

  1. Go to the Gadget app at this URL.

  2. In the left sidebar, expand the Quick start option.

  3. Either select a built-in application or click View All to open the applications library, where you can explore all supported applications along with their descriptions.

  4. Each application includes a set of parameters that define the optimization problem. Customize these parameters to suit your specific requirements.

  5. Optionally, click Next to adjust the genetic algorithm parameters. Note that code-related parameters and certain other settings cannot be modified at this stage.

  6. Click Submit to start executing the submission.

For more details about these applications and their parameters, refer to the Built-in Applications section.

Execution in Progress

While the submission is being executed, you can view or perform the following actions:

  1. Observe a live evolution chart showing how the fitness evolves across generations.

  2. View the status of the execution (e.g., whether it has started, is in progress, failed, completed, etc.).

  3. Monitor the average execution time spent per generation.

  4. Check the remaining time until the execution fails.

  5. Obtain the result ID once the execution completes successfully.

  6. Cancel the submission by clicking the Cancel button.

Submission Result

Once a submission is successfully executed and the results are generated, you can view the outcomes of the optimized solution, including:

  1. The evolution graph of the fitness.

  2. A heat map showing the distribution of the genes throughout the evolution process.

  3. Some problem-specific charts only available for the build-in applications.

  4. A table displaying information about the evolution outcome, including:

    1. Submission ID.

    2. Result ID.

    3. Submission execution date.

    4. Best fitness achieved.

    5. Generation at which the best fitness was achieved.

    6. Total number of generations executed.

    7. Parameters of the best solution.

You also have the option to perform the following actions:

  1. Delete the result.

  2. Edit the submission (if applicable).

  3. Re-execute the submission.

  4. Continue from where the result stopped.

User Submissions

To list all the user submissions, follow these steps:

  1. Go to the Gadget app at this URL.

  2. On the left sidebar, click the User submissions option.

The page has a table with the following columns for each submission:

  1. ID

  2. Type

  3. Creation date

Just click on the submission ID to view the submission details.

You can filter the submissions by their ID using the search box.

To export the table as a CSV file, click on the Export button.

Each record has a Delete button where you can delete the submission.

Submission Details

Follow these steps to access the submission details in Gadget:

  1. Head over to Gadget App.

  2. On the left sidebar, click the User Submissions option.

  3. Locate and click the ID of the submission you wish to explore.

You’ll see a dynamic chart that visually represents the fitness evolution across generations. If the submission has multiple results, the chart will display multiple plots for easy comparison.

A comprehensive table provides key information about the submission, including:

  1. ID: Unique identifier for the submission.

  2. Creation Date: When the submission was created.

  3. Type: The type or category of the submission.

  4. Base Submission ID: (If applicable) The ID of the original submission this one is based on.

  5. Results IDs: List of IDs for all results linked to the submission.

  6. Number of Generations: Total number of generations executed.

  7. Number of Chromosomes: The size of the population in each generation.

  8. Number of Genes: The number of elements (or variables) in each solution.

All results under the same submission share identical parameters, ensuring consistency and comparability.

Edit Submission

The Gadget App offers a feature that allows you to edit your submissions, but only for new submissions where you provided custom code. This feature gives you flexibility to refine or update your entries quickly and efficiently.

Follow these steps to edit a submission with custom code:

  1. Visit the Gadget App.

  2. On the left sidebar, click on User Submissions.

  3. Find and click the ID of the submission you want to edit.

  4. Scroll down and click the Edit button.

  5. A form will open pre-populated with the details from your previous submission.

  6. Make any necessary changes.

  7. Once done, go to the Done tab and click Submit.

You will also find the ID of your previous submission listed as the base submission ID on the details page. This makes it easy to track edits and revisions.

Continue Execution

Sometimes, you might need to achieve a better solution or chromosome than the current result. Gadget provides an option to continue the execution of an already-executed submission.

To continue execution, please follow these steps:

  1. Navigate to the Gadget app at this URL.

  2. On the left sidebar, click the User submissions option.

  3. Click on the ID of the submission you want to continue.

  4. Scroll down to locate the results IDs associated with the submission.

  5. Click on the ID of the result whose execution you want to continue.

  6. Continue Execution

    • Scroll down and click the Continue button.

    • Enter the number of additional generations to execute.

    • Click the Submit button.

If the original result was executed for 100 generations and you choose to continue for another 50 generations, the total execution will be equivalent to 150 generations. This allows you to refine the result further and potentially achieve better outcomes.

Settings

Gadget offers several settings to personalize the app, including:

  1. Save Code: Allows you to save your user-defined code in our database for future reference and re-execution.

  2. Submission Email Notifications: Enables email notifications to be sent once a submission is completed, whether it ends in success or failure.

Parameters

This document provides a brief overview of key parameters and their functions.

Gadget currently utilizes a commercial version of the PyGAD library called PyGADPlus. This is an enhanced version of PyGAD with additional features to extend its functionality.

For detailed information about the supported parameters, refer to the official PyGAD Documentation. It provides a comprehensive guide to the library’s capabilities and configurations, helping you make the most of its integration within Gadget.

1. Mandatory

1.1 Number of Generations

Defines the total number of iterations (or generations) the genetic algorithm will run to evolve solutions.

1.2 Fitness Function

A user-defined function that evaluates how close a solution is to meeting the desired objective.

1.3 Number of Parents

Specifies how many individuals (solutions) are selected as parents for creating offspring in the next generation.

1.4 Number of Genes

Represents the number of elements (variables) in each solution. Each gene corresponds to a component of the solution.

1.5 Number of Chromosomes

The total number of solutions in the population, with each solution represented by a chromosome.

1.6 Fitness Batch Size

Defines the number of solutions evaluated simultaneously in each batch for efficiency in fitness computation.

2. Properties

2.1 Initial Population Range Start

The lower boundary of the range from which the initial population’s genes are randomly generated.

2.2 Initial Population Range End

The upper boundary of the range for initializing genes in the population.

2.3 Initial Population

Allows the user to specify an initial population explicitly, bypassing random generation.

2.4 Gene Data Type

Defines the data type (e.g., integer, float) of the genes, ensuring compatibility with the problem domain.

3. Parents

3.1 Parent Selection Type

Determines the method used for selecting parents, such as “roulette wheel,” “stochastic universal sampling,” or “tournament.”

3.2 Number of Parents to Keep

Specifies how many parents from the current generation are retained in the next generation.

3.3 Number of Elitism to Keep

Indicates the number of top-performing solutions (elite) preserved for the next generation without alteration.

4. Crossover & Mutation

4.1 Crossover Type

Defines the method for combining genes from parent solutions, such as “single-point,” “two-point,” or “uniform.”

4.2 Crossover Probability

Specifies the likelihood that crossover will occur between pairs of parents.

4.3 Mutation Type

Determines how mutations are applied, such as “random” or “swap.”

4.4 Percentage of Genes to Mutate

Defines the proportion of genes in each solution to be mutated.

4.5 Mutation by Replacement?

Indicates whether mutated genes should replace the original genes entirely or modify them.

4.6 Mutation Probability

The probability of applying mutation to a solution during reproduction.

4.7 Number of Genes to Mutate

Specifies the number of genes in each solution to undergo mutation.

4.8 Random Mutation Range Start

The lower limit for generating random values during mutation.

4.9 Random Mutation Range End

The upper limit for random values generated during mutation.

5. Callbacks

5.1 on_start

A user-defined callback function executed at the start of the genetic algorithm.

5.2 on_fitness

Executed after calculating the fitness values for the population.

5.3 on_parents

Called after selecting parents for the next generation.

5.4 on_crossover

Triggered after performing crossover operations.

5.5 on_mutation

Executed after applying mutation to the offspring.

5.6 on_generation

Called at the end of each generation, providing insights into the algorithm’s progress.

5.7 on_stop

Executed when the genetic algorithm stops, either after reaching the stop criteria or completing the set number of generations.

6. Miscellaneous

6.1 Gene Space

Specifies the allowable range or values for each gene, ensuring solutions remain valid.

6.2 Save Best Solutions?

Indicates whether the algorithm should save the best solution found in each generation.

6.3 Save Solutions?

Specifies whether to save all solutions from every generation.

6.4 Allow Duplicate Genes?

Determines if duplicate genes are permitted in a single solution.

6.5 Stop Criteria

Defines the condition(s) under which the algorithm stops early, such as achieving a target fitness value.

6.6 Random Seed

Sets a seed value for random number generation to ensure reproducibility of results.

Built-in Applications

This section highlights the range of examples available in Gadget. Each example is designed to be easily customizable, allowing you to adapt it to your specific requirements by fine-tuning a set of configurable parameters.

If you’re seeking integrations or use cases beyond our current offerings, feel free to reach out. We’re here to provide you with the tools and support needed to address your unique requirements effectively and efficiently.

1. Miscellaneous

1.1 Binary Subset Sum

Demonstrates solving the subset sum problem using a binary representation for genes, where the goal is to find a subset of numbers that sum to a target value.

1.2 Single-Objective Linear Function

Optimizes a single linear function to achieve the maximum or minimum value based on a a single defined constraint.

1.3 Multi-Objective Linear Function

Extends optimization to linear functions with multiple objectives, showcasing trade-offs between competing objectives.

1.4 Non-Deterministic

Illustrates the application of PyGAD for non-deterministic problems, where randomness impacts the optimization process.

1.5 2D Clustering

Solves clustering problems by grouping 2D data points into clusters based on similarity or distance measures.

1.6 Traveling-Salesman Problem Demo

Provides a demonstration of solving the Traveling Salesman Problem (TSP) with a simplified implementation.

1.7 Traveling-Salesman Problem

A complete example of solving TSP using genetic algorithms, optimizing the shortest route for a set of locations.

2. SKLearn

2.1 RFC Hyperparameters Tuning

Uses genetic algorithms to optimize hyperparameters of a Random Forest Classifier in Scikit-Learn, improving model performance.

3. Keras

3.1 XOR Training

Trains a neural network using Keras to solve the XOR problem, with genetic algorithms optimizing weights and biases.

3.2 Multi-Class Classification Training

Applies genetic algorithms to train a multi-class classification neural network using Keras, optimizing its parameters for better accuracy.

3.3 Hyperparameters Tuning

Tunes hyperparameters of Keras models, such as learning rates and layer configurations, using genetic algorithms.

4. PyTorch

4.1 Multi-Class Classification Training

Optimizes weights and biases of a PyTorch neural network for multi-class classification tasks using genetic algorithms.

4.2 Hyperparameters Tuning

Leverages genetic algorithms to fine-tune PyTorch model hyperparameters, enhancing overall training and performance.