Genie Discord forum

Author Avataryakir12
10/3/2023, 2:43:22 PM

Is there a way to either iterate over a zip of two collections, or a collection and it's indices using @recur?

Something like one of the following:

@recur("(i, letter) in zip(1:26, letters)")
@recur("(i, letter) in enumerate(letters)")
Author AvatarPere
10/3/2023, 3:35:21 PM

you can directly use an index without zipping

<div v-for="neurons,index in layer_neurons">
    Layer {{index+2}} <q-slider :min="1" v-model="layer_neurons[index]" label="" :max="16" :step="1"></q-slider>
</div>

layer_neurons = [8,5]

From this demo: https://github.com/BuiltWithGenie/NNtraining

Author Avataryakir12
10/4/2023, 1:19:09 PM

This worked! Thank you!

Author AvatarPere
10/4/2023, 3:23:38 PM

Cool! FYI, anything that goes in a string in the UI function must be valid Javascript, hence why your first attempt didn't work

Author Avataryakir12
10/5/2023, 12:04:40 PM

Yeah, I suspected as much, but it was easiest to illustrate what I needed using Julia code. Thanks!