public Aggregate( CombinationFunction combine, params ISetExpressionTerm[] subExpressions) { mCombine = combine; mSubExpressions = subExpressions; }
public CustomizableNode(CombinationFunction combinationFunction, ActivationFunction activationFunction, float[] constants) : base(constants, activationFunction) { this.combinationFunction = combinationFunction; }
public void Test() { var m = 6; var mod = 7; var expected = new[] { new[] { 1, 0, 0, 0, 0, 0, 0, }, new[] { 1, 1, 0, 0, 0, 0, 0, }, new[] { 1, 2, 1, 0, 0, 0, 0, }, new[] { 1, 3, 3, 1, 0, 0, 0, }, new[] { 1, 4, 6, 4, 1, 0, 0, }, new[] { 1, 5, 3, 3, 5, 1, 0, }, new[] { 1, 6, 1, 6, 1, 6, 1, }, }; var combinationFunction = new CombinationFunction(m, mod); Enumerable.Range(0, m + 1) .Select(n => Enumerable.Range(0, m + 1) .Select(k => (int)combinationFunction.Combination(n, k)) .ToArray() ) .IsSeq(expected); }
public WorleyNoise(int seed, float jitter, DistanceFunction distanceFunc = DistanceFunction.Euclidean, CombinationFunction combinationFunc = CombinationFunction.D1_D0) { Jitter = jitter; Distance = distanceFunc; Combination = combinationFunc; Perm = new NoiseUtil.PermutationTable(1024, 255, seed); }
public void getCombinationFunctionTest() { string func = "sumation"; CombinationFunction expected = CombinationFunctions.sumation; CombinationFunction actual; actual = StandLibFactory.getCombinationFunction(func); Assert.AreEqual(expected, actual); }
public Node() { outConnections = new List<Connection>(); inConnections = new List<Connection>(); inValues = new List<double>(); inWeights = new List<double>(); activate = Activation.SigmoidActivation.evaluate; combine = Combination.Summation.evaluate; fired = false; bias = false; }
IEnumerable <long> Solve() { yield return(n); var combination = new CombinationFunction(n, Mod); // ?? n+1 ???? n ?????1?????????????? // ????1?????2?????? // ??????????3? (P, Q, R) ????????????? p, q, r ???? var p = default(int); var q = default(int); var r = default(int); { // ?? i ? ys[i] ??????????? var ys = Enumerable.Repeat(-1, n + 2).ToArray(); for (var i = 0; i <= n; i++) { var j = ys[xs[i]]; if (j == -1) { ys[xs[i]] = i; } else { p = j; q = i - j - 1; r = (n + 1) - i - 1; break; } } } for (var k = 2; k <= n; k++) { // ???????????????? // PQR var c = 0L; c = combination.Invoke(p + q + r, k); // ???????1??????????? // P1QR + PQ1R - P1R c = (c + combination.Invoke(p + q + r, k - 1)) % Mod; c = (c + combination.Invoke(p + q + r, k - 1)) % Mod; c = (((c - combination.Invoke(p + r, k - 1)) % Mod) + Mod) % Mod; // ???????2????????? // P1Q1R c = (c + combination.Invoke(p + q + r, k - 2)) % Mod; yield return(c); } yield return(1); }
public static IEnumerable <Tuple <T, T, T> > CombinationsWithReplacementsTernary <T>(this IEnumerable <T> iterable) { return(CombinationFunction.CombinationsWithReplacementsTernary(iterable)); }
public static IEnumerable <Tuple <T, T, T, T, T> > CombinationsQuinary <T>(this IEnumerable <T> iterable) { return(CombinationFunction.CombinationsQuinary(iterable)); }