{"record":{"id":"d1997f7e143c8b84","repo":"stanfordnlp/CoreNLP","slug":"unsupported-minimizer-minimizer","errorCode":null,"errorMessage":"Unsupported minimizer ${MINIMIZER}","messagePattern":"Unsupported minimizer (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/parser/dvparser/DVParser.java","lineNumber":296,"sourceCode":"      break;\n    }\n    case 3:{\n      // AdaGrad\n      double eps = 1e-3;\n      double currCost = 0;\n      for(int i = 0; i < op.trainOptions.qnIterationsPerBatch; i++){\n        double[] gradf = gcFunc.derivativeAt(theta);\n        currCost = gcFunc.valueAt(theta);\n        log.info(\"batch cost: \" + currCost);\n        for (int feature =0; feature<gradf.length;feature++ ) {\n          sumGradSquare[feature] = sumGradSquare[feature] + gradf[feature]*gradf[feature];\n          theta[feature] = theta[feature] - (op.trainOptions.learningRate * gradf[feature]/(Math.sqrt(sumGradSquare[feature])+eps));\n        }\n      }\n      break;\n    }\n    default: {\n      throw new IllegalArgumentException(\"Unsupported minimizer \" + MINIMIZER);\n    }\n    }\n\n\n    dvModel.vectorToParams(theta);\n  }\n\n  public DVParser(DVModel model, LexicalizedParser parser) {\n    this.parser = parser;\n    this.op = parser.getOp();\n    this.dvModel = model;\n  }\n\n  public DVParser(LexicalizedParser parser) {\n    this.parser = parser;\n    this.op = parser.getOp();\n\n    if (op.trainOptions.randomSeed == 0) {","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/parser/dvparser/DVParser.java#L278-L314","documentation":"DVParser.executeOneTrainingBatch switches on the MINIMIZER constant to run the selected optimizer (e.g. SGD/AdaGrad variants); the default branch throws IllegalArgumentException for unsupported minimizer values. This is an internal configuration guard — MINIMIZER is a class-level constant not normally exposed as a CLI flag.","triggerScenarios":"A developer editing DVParser source sets MINIMIZER to a value not covered by the switch cases, then calls train, which invokes executeOneTrainingBatch during a training iteration.","commonSituations":"Custom builds of CoreNLP where someone added or changed the minimizer constant; code that programmatically modifies DVParser configuration; version drift where a chosen minimizer name no longer matches the switch.","solutions":["Set MINIMIZER to a value handled by the switch (e.g. the AdaGrad/SGD constant used in the release)","Remove custom minimizer overrides and use the stock DVParser build","If adding a new optimizer, extend the switch in executeOneTrainingBatch before training"],"exampleFix":"// before\nprivate static final int MINIMIZER = 42; // unsupported\n// after\nprivate static final int MINIMIZER = DVParser.ADA_GRAD;","handlingStrategy":"validation","validationCode":"// MINIMIZER is a source-level constant in DVParser\nif (MINIMIZER != DVParser.ADA_GRAD /* and other supported constants */) {\n    throw new IllegalArgumentException(\"MINIMIZER value not supported by executeOneTrainingBatch\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    parser.train(trainTreebank, compTreebank);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"Unsupported minimizer\")) {\n        System.err.println(\"Reset MINIMIZER to a value handled by the training switch\");\n    }\n}","preventionTips":["Never change the MINIMIZER constant without updating the switch in executeOneTrainingBatch","Use stock DVParser builds for training","Cover new optimizer values with tests that run one training batch"],"tags":["invalid-value","training","stanford-corenlp"],"backgroundTag":"invalid-config-value","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}