You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to perform a discrete optimization and I am using the dFST-PSO (=1.8.1 version).
I am having some issues with the usage of an initial guess list, for which the algorithm seems to not convert the discrete problem to a continuous one (while there is no problem when I do initial_guess_list=None). Here I report an example of what I am doing:
The discrete_list is a list-of-list, something like this:
discrete_list = [ [ 'a', 'b', 'c', 'd'], ['e', 'f', 'g'], ['e', 'f', 'g'] ]
So, 3 variables where each of them can be one of those letters. I want to start from an initial list, that is:
initial_guess_list = [ [ 'a', 'g', 'g' ] ]
So, I want the first particle of the first swarm iteration to be equal to this initial guess list, while the other particles (both of the first swarm iteration and of all the next swarm iterations) should be initialized randomly by dFST-PSO.
For this reason, I set initial_guess_list=initial_guess_list. Well, what I receive as output is this:
FST-PSO converted the 3D discrete problem to a 10D real valued probabilistic problem
Search space boundaries automatically set to: [[0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1]]
Max velocities set to: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
Number of particles automatically set to 24
Swarm size now set to 13 particles
Parallel fitness requested
Maximum number of iterations without any update of the global best set to 5
ERROR: each initial guess must have length equal to 10, aborting.
If I set initial_guess_list=None, instead, it does NOT give me ERROR: it creates 13 particles having 3 variables by choosing randomly each of them from those letters I provided in discrete_list, as expected.
Hence, I am just wondering why is it requiring me to provide an initial guess list having a length equal to 10. Is the initial guest list correctly initialized or not? Or could be it related to other kind of issues?
Thank you very much in advance for any help you can provide!
The text was updated successfully, but these errors were encountered:
thank you for pointing out this issue. As a matter of fact, dFST-PSO tries to convert the discrete problem to a continuous one, by estimating the parameters of a probabilistic model generating high quality solutions. When you provide a list of initial guesses, dFST-PSO expects that you provide a list of guesses for the continuous problem (i.e., the probabilities). One possible solution could be to provide an initial guess corresponding to [['a', 'g', 'g']], i.e., [[1,0,0,0,0,0,1,0,0,1]]
This is actually a very interesting bug / unexpected behavior that I will solve immediately. I think that, in the discrete case, the user should provide a hint from the original solution-space and the conversion to probability should be solved (internally and transparently) by dFST-PSO. I will work on that.
Hello Marco,
I want to perform a discrete optimization and I am using the dFST-PSO (=1.8.1 version).
I am having some issues with the usage of an initial guess list, for which the algorithm seems to not convert the discrete problem to a continuous one (while there is no problem when I do initial_guess_list=None). Here I report an example of what I am doing:
nb_particles = 13
FP = FuzzyPSO()
FP.set_search_space_discrete(discrete_list)
FP.set_swarm_size(nb_particles)
FP.set_parallel_fitness(fitness=eval_function_parallel_swarm, arguments=args, skip_test=True)
_, best_fitness, best_solution = FP.solve_with_fstpso(
max_iter=max_swarm_iter, initial_guess_list=initial_guess_list,
max_iter_without_new_global_best=max_swarm_iter_without_new_global_best,
verbose=False
)
The discrete_list is a list-of-list, something like this:
discrete_list = [ [ 'a', 'b', 'c', 'd'], ['e', 'f', 'g'], ['e', 'f', 'g'] ]
So, 3 variables where each of them can be one of those letters. I want to start from an initial list, that is:
initial_guess_list = [ [ 'a', 'g', 'g' ] ]
So, I want the first particle of the first swarm iteration to be equal to this initial guess list, while the other particles (both of the first swarm iteration and of all the next swarm iterations) should be initialized randomly by dFST-PSO.
For this reason, I set initial_guess_list=initial_guess_list. Well, what I receive as output is this:
ERROR: each initial guess must have length equal to 10, aborting.
If I set initial_guess_list=None, instead, it does NOT give me ERROR: it creates 13 particles having 3 variables by choosing randomly each of them from those letters I provided in discrete_list, as expected.
Hence, I am just wondering why is it requiring me to provide an initial guess list having a length equal to 10. Is the initial guest list correctly initialized or not? Or could be it related to other kind of issues?
Thank you very much in advance for any help you can provide!
The text was updated successfully, but these errors were encountered: