{"id":47231410,"url":"https://github.com/openfheorg/python-log-reg-examples","last_synced_at":"2026-03-13T20:28:00.179Z","repository":{"id":219038248,"uuid":"733066857","full_name":"openfheorg/python-log-reg-examples","owner":"openfheorg","description":"Python examples for logistic regression training","archived":false,"fork":false,"pushed_at":"2024-02-20T18:20:16.000Z","size":722,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T11:54:04.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfheorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-18T13:43:03.000Z","updated_at":"2024-11-23T16:27:05.000Z","dependencies_parsed_at":"2024-01-29T22:55:50.869Z","dependency_job_id":null,"html_url":"https://github.com/openfheorg/python-log-reg-examples","commit_stats":null,"previous_names":["openfheorg/python-log-reg-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openfheorg/python-log-reg-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfheorg%2Fpython-log-reg-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfheorg%2Fpython-log-reg-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfheorg%2Fpython-log-reg-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfheorg%2Fpython-log-reg-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfheorg","download_url":"https://codeload.github.com/openfheorg/python-log-reg-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfheorg%2Fpython-log-reg-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30474876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T17:15:31.527Z","status":"ssl_error","status_checked_at":"2026-03-13T17:15:22.394Z","response_time":60,"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":[],"created_at":"2026-03-13T20:27:59.367Z","updated_at":"2026-03-13T20:28:00.167Z","avatar_url":"https://github.com/openfheorg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFHE-Tutorials\n\n## Installing\n\n1. Install [OpenFHE-development](https://github.com/openfheorg/openfhe-development)\n2. Install [OpenFHE-python](https://github.com/openfheorg/openfhe-python)\n\n## Caveats:\n\n- the code shown below is highly unoptimized and is meant to be used for educational purposes.\n\n## Exercises\n\nThere are a total of four exercises:\n\n0) Implementing encrypted inference using the code in `exe_encrypted_inference.py`. Here, you will load in\nweights from a pre-trained model (generated from [efficient_regression/logreg_reference.ipynb](efficient_regression/logreg_reference.ipynb)),\nrepeat the weight vector, do the dot-product, and decrypt. See `sol_encrypted_inference.py` for an example solution.\n\n1) implementing a naive linear regression using the starter code in the [naive_regression](./naive_regression) folder. Work off of\n`exe_lin_reg.py` in this top-level folder and see `sol_lin_reg.py` for one possible solution.\n\n2) Implementing an optimized logistic regression using the starter code in the [efficient_regression](./efficient_regression) folder. Work off of\nthe `exe_log_reg.py` in this top-level folder and see `sol_log_reg.py` for a possible implementation.  You may find it useful to reference\n   the plaintext implementation in `logreg_reference.ipynb` which shows how it is implemented in raw numpy.\n\n3) Implementing an optimized Nesterov-accelerated gradient logistic regression in the [efficient_regression](./efficient_regression) folder. Work off of\n   the `exe_nag_log_reg.py` and see `sol_nag_log_reg.py` for a possible implementation. You may find it useful to reference\n   the plaintext implementation in `logreg_reference.ipynb` which shows how it is implemented in raw numpy.\n\n## Tips\n\nSome tips for working with FHE problems:\n\n1) start with a small-ish ring dimension\n2) turn off the security setting (via `HEStd_NotSet`)\n3) create a reference numpy implementation\n4) Try to do as much as possible in plaintext-space before finally working with ciphertexts \n5) ciphertext refreshing speeds up iteration, so start with that for prototyping then move to bootstrapping","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfheorg%2Fpython-log-reg-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfheorg%2Fpython-log-reg-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfheorg%2Fpython-log-reg-examples/lists"}