/// <summary> /// See <see cref="BPYRepo.SoftmaxShift"/>. /// </summary> public static ExBPY SoftmaxShift(ExBPY sharpness, ExBPY pivot, ExBPY f1, ExBPY f2) => ExMHelpers.SoftmaxShift <TEx <float> >(sharpness, pivot, f1, f2, "x");
/* * public static ExBPY Softmax(ExBPY sharpness, ExBPY[] against) => bpi => GenericMath.Softmax(sharpness(bpi), against.Select(x => x(bpi)).ToArray()); * * public static ExBPY Logsum(ExBPY sharpness, ExBPY[] against) => ExM.LogSum(sharpness, against); */ /// <summary> /// Smoothly pivot from one function to another. /// Functionality is similar to Pivot, but you must specify the direction, and because this relies on softmax, /// the value f2(t) - f2(pivot) + f1(pivot) must always be greater than f1(pivot) after the pivot point /// and less than before the pivot point (when sharpness is positive). /// </summary> /// <param name="pivotVar">The variable upon which pivoting is performed. Should be either "p" (firing index) or "t" (time) or a reference variable.</param> /// <param name="sharpness">The higher the absolute value of this, the more quickly the result will converge. /// Set negative for softmin.</param> /// <param name="pivot">The value of the variable at which pivoting is performed</param> /// <param name="f1">Starting equation</param> /// <param name="f2">Equation after pivot</param> /// <returns></returns> public static ExBPY SoftmaxShift(string pivotVar, ExBPY sharpness, ExBPY pivot, ExBPY f1, ExBPY f2) => ExMHelpers.SoftmaxShift <TExPI>(sharpness, pivot, f1, f2, pivotVar);