// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Turn scores into normalized softmax weights // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set float SCORES and positive TEMPERATURE. Touch to run; output is private to the owner. // Stop / restore: Disable/remove. No scene changes or external calls. // Notes: Temperature controls concentration; these are mathematical weights, not calibrated confidence values. // License: see LICENSE in this distribution. // Original Incoprea. MIT. list SCORES=[1.0,3.0,2.0]; float TEMPERATURE=1.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer n=llGetListLength(SCORES); if(n==0||TEMPERATURE<=0.0) { llOwnerSay("Need scores and positive temperature."); return; } float maximum=llList2Float(SCORES,0); integer i; for(i=1;imaximum)maximum=llList2Float(SCORES,i); list weights; float total; for(i=0;i