{"id":37607570,"url":"https://github.com/thiagopbueno/rddl2tf","last_synced_at":"2026-01-16T10:13:45.018Z","repository":{"id":56444274,"uuid":"148320645","full_name":"thiagopbueno/rddl2tf","owner":"thiagopbueno","description":"RDDL2TensorFlow compiler.","archived":false,"fork":false,"pushed_at":"2020-11-16T16:33:41.000Z","size":155,"stargazers_count":6,"open_issues_count":9,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T10:25:45.852Z","etag":null,"topics":["rddl","tensorflow"],"latest_commit_sha":null,"homepage":"https://rddl2tf.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagopbueno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-11T13:21:09.000Z","updated_at":"2024-06-14T14:20:31.000Z","dependencies_parsed_at":"2022-08-15T18:50:38.587Z","dependency_job_id":null,"html_url":"https://github.com/thiagopbueno/rddl2tf","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/thiagopbueno/rddl2tf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Frddl2tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Frddl2tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Frddl2tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Frddl2tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagopbueno","download_url":"https://codeload.github.com/thiagopbueno/rddl2tf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Frddl2tf/sbom","scorecard":{"id":880846,"data":{"date":"2025-08-11","repo":{"name":"github.com/thiagopbueno/rddl2tf","commit":"ec22986bc9382c40402b27cbdb6edd52c72ce68e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"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":"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":"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":"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":"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE.txt:0"],"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":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52"],"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-24T08:08:20.532Z","repository_id":56444274,"created_at":"2025-08-24T08:08:20.532Z","updated_at":"2025-08-24T08:08:20.532Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["rddl","tensorflow"],"created_at":"2026-01-16T10:13:44.887Z","updated_at":"2026-01-16T10:13:44.986Z","avatar_url":"https://github.com/thiagopbueno.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rddl2tf [![Build Status](https://travis-ci.org/thiagopbueno/rddl2tf.svg?branch=master)](https://travis-ci.org/thiagopbueno/rddl2tf) [![Documentation Status](https://readthedocs.org/projects/rddl2tf/badge/?version=latest)](https://rddl2tf.readthedocs.io/en/latest/?badge=latest) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://github.com/thiagopbueno/rddl2tf/blob/master/LICENSE.txt)\n\nRDDL2TensorFlow compiler in Python3.\n\n# Quickstart\n\n**rddl2tf** is a Python 3.5+ package available in PyPI.\n\n```text\n$ pip3 install rddl2tf\n```\n\n\n# Usage\n\nrddl2tf can be used as a standalone script or programmatically.\n\n\n## Script mode\n\n```text\n$ rddl2tf --help\nusage: rddl2tf [-h] [-b BATCH_SIZE] [--logdir LOGDIR] rddl\n\nrddl2tf (v0.5.1): RDDL2TensorFlow compiler in Python3.\n\npositional arguments:\n  rddl                  path to RDDL file or rddlgym problem id\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -b BATCH_SIZE, --batch-size BATCH_SIZE\n                        number of fluents in a batch (default=256)\n  --logdir LOGDIR       log directory for tensorboard graph visualization\n                        (default=/tmp/rddl2tf)\n```\n\n### Examples\n\n```text\n$ rddl2tf Reservoir-8 --batch-size=1024 --logdir=/tmp/rddl2tf\ntensorboard --logdir /tmp/rddl2tf/reservoir/inst_reservoir_res8\n```\n\n```text\n$ rddl2tf Mars_Rover --batch-size=1024 --logdir=/tmp/rddl2tf\ntensorboard --logdir /tmp/rddl2tf/simple_mars_rover/inst_simple_mars_rover_pics3\n```\n\n\n## Programmatic mode\n\n```python\nimport rddlgym\n\nfrom rddl2tf.compilers import DefaultCompiler\n\n\n# parse RDDL into an AST\nmodel_id = 'Reservoir-8'\nmodel = rddlgym.make(model_id, mode=rddlgym.AST)\n\n# create a RDDL-to-TF compiler\ncompiler = DefaultCompiler(model, batch_size=256)\ncompiler.init()\n\n# compile initial state and default action fluents\nstate = compiler.initial_state()\naction = compiler.default_action()\n\n# compile state invariants and action preconditions\ninvariants = compiler.state_invariants(state)\npreconditions = compiler.action_preconditions(state, action)\n\n# compile action bounds\nbounds = compiler.action_bound_constraints(state)\n\n# compile intermediate fluents and next state fluents\ninterms, next_state = compiler.cpfs(state, action)\n\n# compile reward function\nreward = compiler.reward(state, action, next_state)\n\n# save and visualize the computation graph\nlogdir = os.path.join(args.logdir, model.domain.name, model.instance.name)\nfile_writer = tf.summary.FileWriter(logdir, compiler.graph)\nprint('tensorboard --logdir {}\\n'.format(logdir))\n```\n\n\n# Compiler\n\n## Core API methods\n\n- `rddl2tf.Compiler.initial_state`\n- `rddl2tf.Compiler.default_action`\n- `rddl2tf.Compiler.cpfs`\n- `rddl2tf.Compiler.reward`\n- `rddl2tf.Compiler.state_action_constraints`\n- `rddl2tf.Compiler.action_preconditions`\n- `rddl2tf.Compiler.state_invariants`\n- `rddl2tf.Compiler.action_bound_constraints`\n\n\n## Parameterized Variables (pvariables)\n\nEach RDDL fluent is compiled to a ``rddl2tf.TensorFluent`` after instantiation.\n\nA ``rddl2tf.TensorFluent`` object wraps a ``tf.Tensor`` object. The arity and the number of objects corresponding to the type of each parameter of a fluent are reflected in a ``rddl2tf.TensorFluentShape`` object (the rank of a ``rddl2tf.TensorFluent`` corresponds to the fluent arity and the size of its dimensions corresponds to the number of objects of each type). Also, a ``rddl2tf.TensorFluentShape`` manages batch sizes when evaluating operations in batch mode.\n\nAdditionally, a ``rddl2tf.TensorFluent``keeps information about the ordering of the fluent parameters in a ``rddl2tf.TensorScope`` object.\n\nThe ``rddl2tf.TensorFluent`` abstraction is necessary in the evaluation of RDDL expressions due the broadcasting rules of operations in TensorFlow.\n\n\n## Conditional Probability Functions (CPFs)\n\nEach CPF expression is compiled into an operation in a ``tf.Graph``, possibly composed of many other operations. Typical RDDL operations, functions, and probability distributions are mapped to equivalent TensorFlow ops. These operations are added to a ``tf.Graph`` by recursively compiling the expressions in a CPF into wrapped operations and functions implemented at the ``rddl2tf.TensorFluent`` level.\n\nNote that the RDDL2TensorFlow compiler currently only supports element-wise operations (e.g. ``a(?x, ?y) = b(?x) * c(?y)`` is not allowed). However, all compiled operations are vectorized, i.e., computations are done simultaneously for all object instantiations of a pvariable.\n\nOptionally, during simulation operations can be evaluated in batch mode. In this case, state-action trajectories are generated in parallel by the ``rddl2tf.Simulator``.\n\n\n# Documentation\n\nPlease refer to [https://rddl2tf.readthedocs.io/](https://rddl2tf.readthedocs.io/en/latest/) for the code documentation.\n\n\n# Support\n\nIf you are having issues with ``rddl2tf``, please let me know at: [thiago.pbueno@gmail.com](mailto://thiago.pbueno@gmail.com).\n\n\n# License\n\nCopyright (c) 2018-2020 Thiago Pereira Bueno All Rights Reserved.\n\nrddl2tf is free software: you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or (at\nyour option) any later version.\n\nrddl2tf is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with rddl2tf. If not, see http://www.gnu.org/licenses/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagopbueno%2Frddl2tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagopbueno%2Frddl2tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagopbueno%2Frddl2tf/lists"}