MCPcopy Create free account
hub / github.com/Arm-Examples/ML-examples / fill_sigmas

Function fill_sigmas

kleidiai-examples/audiogen/app/audiogen.cpp:392–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static void fill_sigmas(std::vector<float>& arr, float start, float end, float sigma_max) {
393
394 const int32_t sz = static_cast<int32_t>(arr.size());
395 const float step = ((end - start) / static_cast<float> (sz - 1));
396
397 // Linspace
398 arr[0] = start;
399 arr[sz - 1] = end;
400
401 for(int32_t i = 1; i < sz - 1; ++i) {
402 arr[i] = arr[i - 1] + step;
403 }
404
405 // Sigmoid(-logsnr)
406 for(int32_t i = 0; i < sz; ++i) {
407 arr[i] = 1.0f / (1.0f + std::exp(arr[i])) ;
408 }
409
410 arr[0] = sigma_max;
411 arr[sz - 1] = k_sigma_min;
412}
413
414static void sampler_ping_pong(float* dit_out_data, float* dit_x_in_data, size_t dit_x_in_sz, float cur_t, float next_t, size_t step_idx, size_t seed) {
415

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected