src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_dataset¶
Problem Difficulty Classification¶
Difficulty Mode |
Training Set |
Testing Set |
|---|---|---|
easy |
20% of problems, selected randomly |
Remaining 80% of problems |
difficult |
80% of problems, selected randomly |
Remaining 20% of problems |
Note: The random selection does not use a fixed seed, so the split will vary on each run. When difficulty is ‘all’, both sets contain all 127 problems.
Module Contents¶
Classes¶
Introduction¶Augmented WCCI2020 proposes 127 multi-task benchmark problems to represent a wider range of multi-task optimization problems. |
Functions¶
API¶
- src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_dataset.get_combinations()[source]¶
- class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_dataset.AugmentedWCCI2020_MTO_Tasks(tasks)[source]¶
Initialization
- class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_dataset.Augmented_WCCI2020_Dataset(data, batch_size=1)[source]¶
Bases:
torch.utils.data.DatasetIntroduction¶
Augmented WCCI2020 proposes 127 multi-task benchmark problems to represent a wider range of multi-task optimization problems.
Original Paper¶
None
Official Implementation¶
None
License¶
None
Problem Suite Composition¶
The Augmented WCCI2020 problem suite contains a total of 127 benchmark problems, with each problem consisting of multiple different basic functions with unique transformations(shifts and rotations). The number of basic functions can be specified according to the user’s requirements. Defaults to 10. These 127 benchmark problems are composed based on all combinations of the seven basic functions as Shpere, Rosenbrock, Rastrigin, Ackley, Griewank, Weierstrass and Schwefel. For each benchmark problem, the basic functions in the correspondent combination are selected randomly and added with unique transformations(shifts and rotations) until the number of basic functions is reached.
Methods:¶
get_datasets(version='numpy', train_batch_size=1, test_batch_size=1, difficulty=None, user_train_list=None, user_test_list=None): Static method to generate training and testing datasets based on the specified difficulty or user-provided task lists.__getitem__(item): Retrieves a batch of tasks based on the given index.__len__(): Returns the total number of tasks in the dataset.__add__(other): Combines two datasets into a single dataset.shuffle(): Randomly shuffles the order of tasks in the dataset.
Raises:¶
ValueError: Raised in theget_datasetsmethod if neitherdifficultynoruser_train_listanduser_test_listare provided, or if an invalid difficulty level is specified.
Initialization
Introduction¶
Initializes the Augmented WCCI2020 Dataset with datas.
Args:¶
data(list): A list of tasks, where each task is a list of optimization problems.batch_size(int, optional): The number of tasks to include in each batch. Defaults to 1.
Attributes:¶
data(list): The dataset containing tasks for optimization.batch_size(int): The size of each batch. Defaults to 1.maxdim(int): The maximum dimensionality of the tasks in the dataset.N(int): The total number of tasks in the dataset.ptr(list): A list of indices for batching.index(numpy.ndarray): An array of indices used for shuffling the dataset.
- static get_datasets(version='numpy', train_batch_size=1, test_batch_size=1, difficulty=None, user_train_list=None, user_test_list=None)[source]¶
Introduction¶
Generates training and testing datasets for the Augmented WCCI2020 benchmark suite based on specified difficulty or user-defined function lists.
Args:¶
version(str, optional): Specifies the implementation version to use for function instances. Accepts ‘numpy’ or any other string for alternative (e.g., ‘torch’). Defaults to ‘numpy’.train_batch_size(int, optional): Batch size for the training dataset. Defaults to 1.test_batch_size(int, optional): Batch size for the testing dataset. Defaults to 1.difficulty(str, optional): Difficulty level for dataset split. Accepts ‘easy’, ‘difficult’, ‘all’, or None. If None,user_train_listanduser_test_listmust be provided.user_train_list(list of int, optional): List of function IDs to include in the training set. Used ifdifficultyis None.user_test_list(list of int, optional): List of function IDs to include in the testing set. Used ifdifficultyis None.
Returns:¶
tuple: A tuple containing two
Augmented_WCCI2020_Datasetobjects:The first is the training dataset.
The second is the testing dataset.
Raises:¶
ValueError: If neitherdifficultynor bothuser_train_listanduser_test_listare provided.ValueError: If an invaliddifficultyvalue is specified.
- __getitem__(item)[source]¶
Introduction¶
Retrieves a batch of tasks of the the Augmented WCCI2020 benchmark suite based on the given index.
Args:¶
item(int, optional): Specifies which batch of tasks of the Augmented WCCI2020 benchmark is selected.
Returns:¶
list: A list containing a batch of tasks of the Augmented WCCI2020 benchmark.
- __len__()[source]¶
Introduction¶
Returns the total number of tasks in the Augmented WCCI2020 benchmark suite.
Returns:¶
int: The size of the Augmented WCCI2020 benchmark suite.
- __add__(other: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_dataset.Augmented_WCCI2020_Dataset)[source]¶
Introduction¶
Combines two datasets into a single dataset.
Returns:¶
Object: The combined new dataset of the Augmented WCCI2020 benchmark suite.