{"id":18604966,"url":"https://github.com/finmath/finmath-lib-automaticdifferentiation-extensions","last_synced_at":"2025-10-29T02:12:04.763Z","repository":{"id":57737157,"uuid":"95090113","full_name":"finmath/finmath-lib-automaticdifferentiation-extensions","owner":"finmath","description":"Provides additional classes for automatic differentiations (e.g. backward automatic differentiation - aka AAD).","archived":false,"fork":false,"pushed_at":"2018-10-19T17:03:13.000Z","size":502,"stargazers_count":17,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T05:43:47.373Z","etag":null,"topics":["aad","automatic-differentiations","finmath-lib"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/finmath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-22T08:00:13.000Z","updated_at":"2024-05-28T05:53:46.000Z","dependencies_parsed_at":"2022-08-24T14:57:20.323Z","dependency_job_id":null,"html_url":"https://github.com/finmath/finmath-lib-automaticdifferentiation-extensions","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/finmath/finmath-lib-automaticdifferentiation-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finmath%2Ffinmath-lib-automaticdifferentiation-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finmath%2Ffinmath-lib-automaticdifferentiation-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finmath%2Ffinmath-lib-automaticdifferentiation-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finmath%2Ffinmath-lib-automaticdifferentiation-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finmath","download_url":"https://codeload.github.com/finmath/finmath-lib-automaticdifferentiation-extensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finmath%2Ffinmath-lib-automaticdifferentiation-extensions/sbom","scorecard":{"id":400209,"data":{"date":"2025-08-11","repo":{"name":"github.com/finmath/finmath-lib-automaticdifferentiation-extensions","commit":"7eb9c780f327bee3b43e091a38b8966f145b894a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-2qp4-g3q3-f92w","Warn: Project is vulnerable to: GHSA-cqj8-47ch-rvvq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T19:55:17.371Z","repository_id":57737157,"created_at":"2025-08-18T19:55:17.371Z","updated_at":"2025-08-18T19:55:17.371Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281544195,"owners_count":26519554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aad","automatic-differentiations","finmath-lib"],"created_at":"2024-11-07T02:19:31.155Z","updated_at":"2025-10-29T02:12:04.727Z","avatar_url":"https://github.com/finmath.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# finmath-lib automatic differentiation extensions\n- - - -\n**Enabling finmath lib to utilize automatic differentiation algorithms (e.g. AAD).**\n- - - -\nThis project implements a [stochastic automatic differentiation](http://ssrn.com/abstract=2995695).\n\nThe implementation is fast, memory efficient and thread safe. It handles automatic differentiation of the conditional expectation (American Monte-Carlo), see http://ssrn.com/abstract=3000822.\n\nThe project provides an interface \u003ccode\u003eRandomVariableDifferentiableInterface\u003c/code\u003e\nfor random variables which provide automatic differentiation.\nThe interface extends \u003ccode\u003eRandomVariableInterface\u003c/code\u003e and\nhence allows to use auto-diff in all Monte-Carlo contexts\n(via a replacement of the corresponding parameters / factories).\n\nThe project also provides implementations of this interface, e.g. utilizing\nthe backward (a.k.a. adjoint) method via \u003ccode\u003eRandomVariableDifferentiableAADFactory\u003c/code\u003e.\nThis factory creates a random variable \u003ccode\u003eRandomVariableDifferentiableAAD\u003c/code\u003e which implements \u003ccode\u003eRandomVariableDifferentiableInterface\u003c/code\u003e.\n\nAll the backward automatic differentiation code is contained in\n\u003ccode\u003eRandomVariableDifferentiableAAD\u003c/code\u003e.\n\nThe interface \u003ccode\u003eRandomVariableInterface\u003c/code\u003e is provided by [finmath-lib](http://finmath.net/finmath-lib) and specifies the arithmetic operations which may be performed on random variables, e.g.,\n\n\tRandomVariableDifferentiableInterface add(RandomVariableDifferentiableInterface randomVariable);\t\n\tRandomVariableDifferentiableInterface mult(RandomVariableDifferentiableInterface randomVariable);\n\tRandomVariableDifferentiableInterface exp();\n\t\n\t// ...\t\n\nThe interface \u003ccode\u003eRandomVariableDifferentiableInterface\u003c/code\u003e will introduce\ntwo additional methods:\n\n\tLong getID();\t\n\tMap\u003cLong, RandomVariableInterface\u003e getGradient();\n\nThe method \u003ccode\u003egetGradient\u003c/code\u003e will return a map providing the\nfirst order differentiation of the given random variable (\u003ccode\u003ethis\u003c/code\u003e)\nwith respect to *all* its input \u003ccode\u003eRandomVariableDifferentiableInterface\u003c/code\u003es (leaf nodes). To get the differentiation with respect to a specific object use\n\n\t/* Get the gradient of X with respect to all its leaf nodes: /*\n\tMap gradientOfX = X.getGradient();\n\n\t/* Get the derivative of X with respect to Y: */\n\tRandomVariableInterface derivative = gradientOfX.get(Y.getID());\n\n### AAD on Cuda GPUs\n\nIt is possible to combine the automatic-differentiation-extensions with the cuda-extensions.\n\nUsing\n\n\tAbstractRandomVariableFactory randomVariableFactory = new RandomVariableDifferentiableAADFactory();\n\nwill create a standard (CPU) random variable with automatic differentiation. Instead, using\n\n\tAbstractRandomVariableFactory randomVariableFactory = new RandomVariableDifferentiableAADFactory(new RandomVariableCudaFactory());\n\nwill create a Cuda GPU random variable with automatic differentiation.\n\n### Example\n\nThe following sample code calculates valuation, delta, vega and rho for an\nalmost arbitrary product (here an EuropeanOption) using\nAAD on the Monte-Carlo valuation\n\n\tRandomVariableDifferentiableAADFactory randomVariableFactory = new RandomVariableDifferentiableAADFactory();\n\t\n\t// Generate independent variables (quantities w.r.t. to which we like to differentiate)\n\tRandomVariableDifferentiableInterface initialValue\t= randomVariableFactory.createRandomVariable(modelInitialValue);\n\tRandomVariableDifferentiableInterface riskFreeRate\t= randomVariableFactory.createRandomVariable(modelRiskFreeRate);\n\tRandomVariableDifferentiableInterface volatility\t= randomVariableFactory.createRandomVariable(modelVolatility);\n\t\n\t// Create a model\n\tAbstractModel model = new BlackScholesModel(initialValue, riskFreeRate, volatility);\n\t\n\t// Create a time discretization\n\tTimeDiscretizationInterface timeDiscretization = new TimeDiscretization(0.0 /* initial */, numberOfTimeSteps, deltaT);\n\t\n\t// Create a corresponding MC process\n\tAbstractProcess process = new ProcessEulerScheme(new BrownianMotion(timeDiscretization, 1 /* numberOfFactors */, numberOfPaths, seed));\n\t\n\t// Using the process (Euler scheme), create an MC simulation of a Black-Scholes model\n\tAssetModelMonteCarloSimulationInterface monteCarloBlackScholesModel = new MonteCarloAssetModel(model, process);\n\t\n\t/*\n\t * Value a call option (using the product implementation)\n\t */\n\tEuropeanOption europeanOption = new EuropeanOption(optionMaturity, optionStrike);\n\tRandomVariableInterface value = (RandomVariableDifferentiableInterface) europeanOption.getValue(0.0, monteCarloBlackScholesModel);\n\t\n\t/*\n\t * Calculate sensitivities using AAD\n\t */\n\tMap\u003cLong, RandomVariableInterface\u003e derivative = ((RandomVariableDifferentiableInterface)value).getGradient();\n\t\t\n\tdouble valueMonteCarlo = value.getAverage();\n\tdouble deltaAAD = derivative.get(initialValue.getID()).getAverage();\n\tdouble rhoAAD = derivative.get(riskFreeRate.getID()).getAverage();\n\tdouble vegaAAD = derivative.get(volatility.getID()).getAverage();\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinmath%2Ffinmath-lib-automaticdifferentiation-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinmath%2Ffinmath-lib-automaticdifferentiation-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinmath%2Ffinmath-lib-automaticdifferentiation-extensions/lists"}