{"id":13784282,"url":"https://github.com/locuslab/orthogonal-convolutions","last_synced_at":"2025-04-23T20:32:30.338Z","repository":{"id":96318706,"uuid":"347498700","full_name":"locuslab/orthogonal-convolutions","owner":"locuslab","description":"Implementations of orthogonal and semi-orthogonal convolutions in the Fourier domain with applications to adversarial robustness","archived":false,"fork":false,"pushed_at":"2021-04-09T17:22:09.000Z","size":314,"stargazers_count":44,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T20:11:19.347Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/locuslab.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}},"created_at":"2021-03-13T23:06:11.000Z","updated_at":"2025-02-26T01:48:24.000Z","dependencies_parsed_at":"2023-03-30T20:47:54.267Z","dependency_job_id":null,"html_url":"https://github.com/locuslab/orthogonal-convolutions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Forthogonal-convolutions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Forthogonal-convolutions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Forthogonal-convolutions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Forthogonal-convolutions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locuslab","download_url":"https://codeload.github.com/locuslab/orthogonal-convolutions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509865,"owners_count":21442514,"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","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":"2024-08-03T19:00:39.212Z","updated_at":"2025-04-23T20:32:29.650Z","avatar_url":"https://github.com/locuslab.png","language":"Jupyter Notebook","funding_links":[],"categories":["📝 Publications \u003csmall\u003e(60)\u003c/small\u003e"],"sub_categories":[],"readme":"# Orthogonalizing Convolutional Layers with the Cayley Transform\n\u003cimg align=\"right\" width=\"400\" src=\"img/ICLR-Thumbnail-Fourier.001.png\"\u003e\n\u003cp\u003eThis repository contains implementations and source code to reproduce experiments\nfor the ICLR 2021 spotlight paper \u003ca href=\"https://openreview.net/forum?id=Pbj8H_jEHYv\"\u003eOrthogonalizing Convolutional Layers with the Cayley Transform\u003c/a\u003e\nby Asher Trockman and Zico Kolter.\u003c/p\u003e\n\n\u003cp\u003e\nCheck out our tutorial on\nFFT-based convolutions and how to orthogonalize them\n\u003ca href=\"https://nbviewer.jupyter.org/github/locuslab/orthogonal-convolutions/blob/main/FFT%20Convolutions.ipynb\"\u003ein this Jupyter notebook\u003c/a\u003e.\n\u003c/p\u003e\n\n*(more information and code coming soon)*\n\n### Getting Started\n\nYou can clone this repo using:\n```\ngit clone https://github.com/locuslab/orthogonal-convolutions --recursive\n```\nwhere the `--recursive` is necessary for the submodules.\n\nThe most important dependency is **PyTorch \u003e= 1.8**. If you like, you can set up a new conda environment:\n\n```\nconda create --name orthoconv python=3.6\nconda activate orthoconv\nconda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge\nconda install --file requirements.txt\n```\n\n### The Orthogonal Convolutional Layer\n\nOur orthogonal convolutional layer can be found in `layers.py`. The actual layer is the module `CayleyConv`. It depends on the function `cayley`, our implementation of the Cayley transform for (semi-)orthogonalization. Additionally, `CayleyConv` is a subclass of `StridedConv`, which emulates striding functionality by reshaping the input tensor.\n\n### Running Experiments\n\nThe script `train.py` can be used to run most of the experiments from our paper. To try the \"flagship\" experiment demonstrating better clean accuracy and \u003cimg src=\"https://render.githubusercontent.com/render/math?math=\\ell_2\"\u003e-norm-bounded deterministic certifiable robustness, run:\n\n```\npython train.py --epochs=200 --conv=CayleyConv --linear=CayleyLinear\n```\n\nTo compare with BCOP as in our paper, run:\n\n```\npython train.py --epochs=200 --conv=BCOP --linear=BjorckLinear\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Forthogonal-convolutions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocuslab%2Forthogonal-convolutions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Forthogonal-convolutions/lists"}