The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Macro(Macro)?"
Schalkekid
Member Posts: 17 Maven
Hi everybody,
I am wondering, if it is possible to change parameter values of an operator which is processed in a loop according to the current iteration number.
I want to change the "convergence epsilon" parameter of the SVM-Operator during a binary2multiclass chain, to have different values at different iterations.
I had the idea to define macros outside the chain for every iteration: epsilon0, epsilon1, epsilon2, ...
And now I tried to access the macros inside the chain via %{epsilon%{a}}. Unfortunately, this is does not work.
Do you have any ideas how I could manage this.
Perhaps there is another way to create a process which works in the way I described here?!
Best,
Felix
I am wondering, if it is possible to change parameter values of an operator which is processed in a loop according to the current iteration number.
I want to change the "convergence epsilon" parameter of the SVM-Operator during a binary2multiclass chain, to have different values at different iterations.
I had the idea to define macros outside the chain for every iteration: epsilon0, epsilon1, epsilon2, ...
And now I tried to access the macros inside the chain via %{epsilon%{a}}. Unfortunately, this is does not work.
Do you have any ideas how I could manage this.
Perhaps there is another way to create a process which works in the way I described here?!
Best,
Felix
0
Answers
In the past I have concatenated macros within loops, so if %{H}=="hope" and %{T}=="that" and %{h} =="helps" I could make this message...
%{H}" "%{T}" "%{h}
Which I do ;D
that's a nice example. But I have the problem, that I want to dynamically access a macro called 'hope that helps' by the other three macros?
That's the problem I have.
For your example, I would use %{%{H}" "%{T}" "%{h}}, and this does not work.
Best,
Felix
Putting a macro inside a macro is where the problem lies, because a macro is just shorthand for the string it represents. Make a macro at each level of your nested loops, and then join them together.. so "epsilon%{xx}%{yy}" rather than "epsilon%{xx%{yy}}".
%{H}" "%{T}" "%{h}!
I think that won't help me.
I have a problem to access a macro dynamically.
The macros are containing double values, and they are called:
epsilon0
epsilon1
Can I access the values of the macros in a (for this case) twofold crossvalidation for instance?
If nested macros would be possible, I would do something like setting a new macro inside the crossvalidation:
valueMacro = %{epsilon%{a}}
and use %{valueMacro} as a parameter inside the crossValidation.
How can I do so by not using nested macros?
Best,
Felix
You can access macros, and generate new ones from them like this..
that's very interesting but still won't help me with my current problem.
I don't want to multiply or add the 'iteration number' to some other macro.
I want to use the 'iteration number' to select (switch/case or if/else) a special macro value out of a number of predefined macros. In my experiment there is one macro for every iteration number - which are defined outside the macro.
Best,
Felix
you can use the approach haddock outlined and incorporate nested if conditions to select the macro. I don't think there's another solution unless you use a second data table storing the different values. You could then extract the macro from the second data table (possible loaded by a recall operator) on a row defined by another macro.
Greetings,
Sebastian
Best,
Felix