Hi,
I’m still working on the problem I have been asking so many
questions about. Following your advice I have reformulated the problem
and successfully compiled and run it. However, I got a “THE MODEL
EXCEEDS THE DEMO LIMITS”.
As you said last time, multiplying indicator with the values I want to
minimize is not a good idea. And I wonder if you would be kind enough
to hint me some better ways.
Moreover, right now I’m testing the program with dummy data, so the
dimension you see in the program is really small. But the problem I
really want to solve involves:
set face_number /11000/;
set new_face_vector_length /1100/;
set old_face_vector_length /1*200/;
So even if I improve my program, will the demo version of GAMS be able
to solve the problem? Or do I need to submit it to places like NEOS?
This is what my program look like right now:
set face_number /18/;
set new_face_vector_length face vectors multiplied by M /13/;
set old_face_vector_length face vectors that already multiplied
eigenface /1*5/;
parameter face_vectors(face_number, old_face_vector_length) /
$ondelim
$include face_vectors.txt
$offdelim
/;
variable M(new_face_vector_length, old_face_vector_length);
variable projected_face_vectors(face_number, new_face_vector_length);
equations projection(face_number, new_face_vector_length);
projection(face_number, new_face_vector_length) …
projected_face_vectors(face_number, new_face_vector_length)
=e= sum(old_face_vector_length, M(new_face_vector_length,
old_face_vector_length) * face_vectors(face_number,
old_face_vector_length));
integer variable indicator(face_number, face_number, face_number);
integer variable artificial_var1(face_number, face_number,
face_number);
integer variable artificial_var2(face_number, face_number,
face_number);
integer variable artificial_var3(face_number, face_number,
face_number);
integer variable artificial_var4(face_number, face_number,
face_number);
variable cost;
alias (face_number, f1, f2, f3, f4, f5, f6, f7, f8, f9);
alias (new_face_vector_length, n1, n2, n3, n4, n5, n6);
alias (old_face_vector_length, o1, o2, o3, o4, o5, o6);
equations cost_function;
cost_function …
cost =e= sum((f1, f2, f3),
indicator(f1, f2, f3)*
(sum(n1, power(projected_face_vectors(f1, n1) -
projected_face_vectors(f3, n1), 2)) -
sum(n2, power(projected_face_vectors(f1, n2) -
projected_face_vectors(f2, n2), 2))));
equations filter_function1(f4, f5, f6), filter_function2(f4, f5, f6),
filter_function3(f4, f5, f6), filter_function4(f4, f5, f6),
filter_function5(f4, f5, f6);
filter_function1(f4, f5, f6) …
sum(o2, power(face_vectors(f4, o2) - face_vectors(f6, o2), 2)) -
sum(o1, power(face_vectors(f4, o1) - face_vectors(f5, o1), 2))
=l= 50 * 5 * (1 - artificial_var1(f4, f5, f6));
filter_function2(f4, f5, f6) …
sum(o4, power(face_vectors(f4, o4) - face_vectors(f6, o4), 2)) -
(-50 * 5 - 0.000001) * artificial_var2(f4, f5, f6)
=g= sum(o3, power(face_vectors(f4, o3) - face_vectors(f5, o3), 2)) +
0.000001;
filter_function3(f4, f5, f6) …
sum(n3, power(projected_face_vectors(f4, n3) -
projected_face_vectors(f5, n3), 2)) -
sum(n4,power(projected_face_vectors(f4, n4) -
projected_face_vectors(f6, n4), 2))
=l= 50 * 3 * (1 - artificial_var3(f4, f5, f6));
filter_function4(f4, f5, f6) …
sum(n5, power(projected_face_vectors(f4, n5) -
projected_face_vectors(f5, n5), 2)) -
(-50 * 3 - 0.000001) * artificial_var4(f4, f5, f6)
=g= sum(n6, power(projected_face_vectors(f4, n6) -
projected_face_vectors(f6, n6), 2)) + 0.000001;
filter_function5(f4, f5, f6) …
artificial_var1(f4, f5, f6) * artificial_var2(f4, f5, f6) *
artificial_var3(f4, f5, f6) * artificial_var4(f4, f5, f6)
=e= indicator(f4, f5, f6);
Model new_projection_space /all/ ;
Solve new_projection_space using minlp minimizing cost ;
display M.l, M.m;
And my dummy testing data:
1 1 1.1
1 2 2.4
1 3 3.9
1 4 9.1
1 5 1.5
2 1 2.3
2 2 1.6
2 3 8.1
2 4 0.5
2 5 2.6
3 1 5.4
3 2 3.4
3 3 2.1
3 4 4.6
3 5 4.8
4 1 8.7
4 2 7.1
4 3 3.5
4 4 6.1
4 5 9.3
5 1 2.0
5 2 1.9
5 3 5.4
5 4 8.2
5 5 3.9
6 1 6.5
6 2 4.7
6 3 8.3
6 4 9.2
6 5 0.7
7 1 0.6
7 2 3.8
7 3 4.5
7 4 2.1
7 5 5.6
8 1 3.4
8 2 5.8
8 3 6.9
8 4 0.4
8 5 2.5
Many thanks to all the your help.
I truly appreciated it.
Eunice Chen
–~–~---------~–~----~------------~-------~–~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~–~—
\