Random Adam Update Test Case Generator

Build a bounded reproducible adam update test case from explicitly supplied candidate scenarios. Every candidate must satisfy imported optimization/adam-step before selection; answer cards preserve its units, conventions, domain limitations and signed/unknown results. Draws are uniform over caller candidate positions; no replacement means no repeated positions, not necessarily distinct answers. No automatic pedagogical correctness, compliance or physical readiness.

Description

Adam updates a parameter using exponentially weighted first and second gradient moments with bias correction.

Adam updates a parameter using exponentially weighted first and second gradient moments with bias correction.1

These fixtures sample supplied scalar optimizer states and return one update without computing gradients or training a model.

When to use Random Adam Update Test Case Generator

Use this tool when you need to assemble reproducible practice cards from a supplied, validated scenario corpus. Prepare a reproducible seed and the inventory, corpus, or experiment parameters stated below.

How to use Random Adam Update Test Case Generator and understand its results

  1. Prepare a reproducible seed and the inventory, corpus, or experiment parameters stated below.
  2. Enter seed, count, withoutReplacement, candidateInputsJson, following the field table and calculation rules below, then run the tool.
  3. Read result. For result objects, inspect the nested output fields below, including any missing evidence or selected indices.
  4. Correct any input issues and run again. Before using a successful result, review its units, signs, evidence coverage, and stated model or reference assumptions.
Input fieldMeaningValue typeRequirement
seedRequired nonblank deterministic seed; the SDK can replace the source with context.random.stringRequired
countNumber of draws, cards, trials, or output entries under the tool-specific rule; safe integer 1–64 with any narrower inventory bound.numberRequired
withoutReplacementTrue removes selected inventory positions; false permits repeated positions. Equal rendered values or answers can still occur.booleanRequired
candidateInputsJsonDense list of JSON objects serialized as strings for the imported calculator; every candidate must be valid.list of stringRequired

Enter 1–128 dense candidateInputsJson strings, each a strict JSON object for the imported calculator. Each string is at most 8192 UTF-16 units, the corpus at most 131072, and nesting at most 16 levels; nonfinite numbers and prototype-control keys are rejected. Select candidate positions under the sampling rules, then validate every candidate, including undrawn ones, by invoking the imported calculator with a fixed random source of 0.5. Any invalid candidate fails the whole request. Invoke it again for selected candidates with the request’s advancing source, and return original inputs, actual answer objects, selected indices, and never-selected indices. Duplicate candidate texts or equal answers may occur at distinct positions.2, 3, 4

Use a nonblank seed of at most 256 UTF-16 units and a safe-integer count from 1 to 64, subject to the tool’s narrower inventory bound. By default the seed is hashed into a deterministic pseudorandom state; each run restarts that state, so identical full inputs and implementation reproduce the result. The SDK may provide context.random, which replaces the seeded source and advances across the request; the seed remains required. Every source value must be finite in [0,1), with a request limit of 100000 source calls. Draw an index as floor(U×remainingSize). For indexed inventory draws, with replacement draw from the full inventory each time; without replacement remove each chosen position from an ordered pool and reject counts exceeding the inventory size. Uniform-source draws are over positions, not necessarily distinct values. This is not secure randomness.

The imported calculator requires step≥1, positive learning rate and epsilon, nonnegative second moment, and beta values in [0,1). Update both moments, divide by one minus beta to the step, compute learningRate times correctedFirst divided by sqrt(correctedSecond)+epsilon, and subtract it from the parameter. Numeric outputs are rounded to twelve significant digits.

m′=β1m+(1−β1)g; v′=β2v+(1−β2)g²; update=η(m′/(1−β1^t))/(sqrt(v′/(1−β2^t))+ε)

Read these symbols with the field meanings and branch or reference rules above.

Output fieldMeaningValue type
resultComposite output; read its nested fields and the worked example.object
result.baseToolIdCanonical identifier of the imported answer calculator.string
result.selectedCandidateIndicesZero-based positions in the original candidate corpus, in draw order.list
result.unusedCandidateIndicesOriginal candidate positions never selected during this request.list
result.exercisesSelected supplied input objects paired with their actual imported answer objects and any stated additional outputs.list

Each result.exercises entry preserves its supplied input and imported answer object. Additional roundTripAnswer, secondaryAnswer, prompts, or derived quantities appear only where the mechanics above describe them. selectedCandidateIndices and unusedCandidateIndices refer to the original corpus positions, not answer values.

json
{
  "input": {
    "seed": "tool.io/batch42",
    "count": 1,
    "withoutReplacement": true,
    "candidateInputsJson": [
      "{\"betaOne\": 0.9, \"betaTwo\": 0.999, \"epsilon\": 1e-08, \"firstMoment\": 0, \"gradient\": 0.1, \"learningRate\": 0.001, \"parameter\": 1, \"secondMoment\": 0, \"step\": 1}"
    ]
  },
  "output": {
    "result": {
      "baseToolId": "optimization/adam-step",
      "selectedCandidateIndices": [
        0
      ],
      "unusedCandidateIndices": [],
      "exercises": [
        {
          "input": {
            "betaOne": 0.9,
            "betaTwo": 0.999,
            "epsilon": 1e-8,
            "firstMoment": 0,
            "gradient": 0.1,
            "learningRate": 0.001,
            "parameter": 1,
            "secondMoment": 0,
            "step": 1
          },
          "answer": {
            "result": {
              "correctedFirstMoment": 0.1,
              "correctedSecondMoment": 0.01,
              "firstMoment": 0.01,
              "parameter": 0.9990000001,
              "secondMoment": 0.00001,
              "step": 1,
              "update": 0.0009999999
            }
          }
        }
      ]
    }
  }
}

Limitations and assumptions

The default source is deterministic pseudorandomness, not an independently audited or secure draw. Replacement applies to inventory positions; distinct positions may render identically or yield equal answers. A fixture does not independently verify the supplied answers or reference content. Each answer retains the imported calculator’s unit conventions and domain assumptions. Randomizing a supplied scenario does not broaden that calculator’s capabilities.

Missing required fields, unknown fields, wrong types, and violated calculation rules return input issues. Numeric values must be finite; nonfinite numeric outputs are rejected. Arrays must be dense, with no missing cells. Extremely large composite outputs are rejected.

Alternative or Complementary methods

For a related task, use Random Gradient Step Exercise Generator: A gradient-descent step subtracts a scaled gradient from the current parameter vector. These fixtures sample supplied vectors and learning rates; the gradient is input data rather than something the tool derives from an objective. For a complementary step, use Random Jackknife Bias Exercise Generator: Jackknife bias estimation compares a statistic on the full sample with the average of its leave-one-out estimates. These cards sample supplied datasets and return the mean or median bias calculation rather than generating measurements.

References

  1. Random Adam Update Test Case Generator — tool.io

  2. Calculation or validation: optimization/adam-step — tool.io

  3. Calculation or validation: random/seeded-number — tool.io

  4. Calculation or validation: random/number — tool.io

Similar or alternative tools

  • Random Gradient Step Exercise Generator

    A gradient-descent step subtracts a scaled gradient from the current parameter vector. These fixtures sample supplied vectors and learning rates; the gradient is input data rather than something the tool derives from an objective.

  • Random Jackknife Bias Exercise Generator

    Jackknife bias estimation compares a statistic on the full sample with the average of its leave-one-out estimates. These cards sample supplied datasets and return the mean or median bias calculation rather than generating measurements.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies