{"id":24771067,"url":"https://github.com/pfcclab/paddle_harmonics","last_synced_at":"2025-03-23T20:26:47.660Z","repository":{"id":273637636,"uuid":"890098822","full_name":"PFCCLab/paddle_harmonics","owner":"PFCCLab","description":"Differentiable signal processing on the sphere for Paddle","archived":false,"fork":false,"pushed_at":"2025-01-22T03:44:46.000Z","size":3705,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-01-22T04:26:29.240Z","etag":null,"topics":["machine-learning","paddle","signal-processing","sphere"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PFCCLab.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,"publiccode":null,"codemeta":null}},"created_at":"2024-11-18T01:28:45.000Z","updated_at":"2025-01-22T03:44:50.000Z","dependencies_parsed_at":"2025-01-22T04:26:34.256Z","dependency_job_id":"c934dea7-b47a-4e95-a340-0ac814e87e66","html_url":"https://github.com/PFCCLab/paddle_harmonics","commit_stats":null,"previous_names":["pfcclab/paddle_harmonics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PFCCLab%2Fpaddle_harmonics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PFCCLab%2Fpaddle_harmonics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PFCCLab%2Fpaddle_harmonics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PFCCLab%2Fpaddle_harmonics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PFCCLab","download_url":"https://codeload.github.com/PFCCLab/paddle_harmonics/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245163972,"owners_count":20571033,"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":["machine-learning","paddle","signal-processing","sphere"],"created_at":"2025-01-29T03:57:45.427Z","updated_at":"2025-03-23T20:26:47.620Z","avatar_url":"https://github.com/PFCCLab.png","language":"Jupyter Notebook","readme":"# paddle_harmonics(Paddle Backend)\n\n\u003e [!IMPORTANT]\n\u003e This branch(paddle) experimentally supports [Paddle backend](https://www.paddlepaddle.org.cn/en/install/quick?docurl=/documentation/docs/en/develop/install/pip/linux-pip_en.html)\n\u003e as almost all the core code has been completely rewritten using the Paddle API.\n\u003e\n\u003e It is recommended to install [**Paddle 3.0 or develop**](https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html) Paddle before running any code in this branch.\n\nInstall:\n\n``` shell\n# paddlepaddle develop\npython -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu118/\npip install -r requirements.txt\n\npip install .\n\n# test\npytest -v ./tests\n\n# example\nmkdir examples/checkpoints\nmkdir examples/figures\nmkdir examples/output_data\npython examples/train_sfno.py\n\n# notebooks\nmkdir notebooks/data\nmkdir notebooks/plots\nchmod a+rwx notebooks/data\nchmod a+rwx notebooks/plots\n```\n\n## example code\n\n``` python\nimport math\nimport unittest\n\nimport numpy as np\nimport paddle\n\nclass TestLegendrePolynomials(unittest.TestCase):\n    def setUp(self):\n        self.cml = lambda m, l: np.sqrt((2 * l + 1) / 4 / np.pi) * np.sqrt(\n            math.factorial(l - m) / math.factorial(l + m)\n        )\n        self.pml = dict()\n\n        # preparing associated Legendre Polynomials (These include the Condon-Shortley phase)\n        # for reference see e.g. https://en.wikipedia.org/wiki/Associated_Legendre_polynomials\n        self.pml[(0, 0)] = lambda x: np.ones_like(x)\n        self.pml[(0, 1)] = lambda x: x\n        self.pml[(1, 1)] = lambda x: -np.sqrt(1.0 - x**2)\n        self.pml[(0, 2)] = lambda x: 0.5 * (3 * x**2 - 1)\n        self.pml[(1, 2)] = lambda x: -3 * x * np.sqrt(1.0 - x**2)\n        self.pml[(2, 2)] = lambda x: 3 * (1 - x**2)\n        self.pml[(0, 3)] = lambda x: 0.5 * (5 * x**3 - 3 * x)\n        self.pml[(1, 3)] = lambda x: 1.5 * (1 - 5 * x**2) * np.sqrt(1.0 - x**2)\n        self.pml[(2, 3)] = lambda x: 15 * x * (1 - x**2)\n        self.pml[(3, 3)] = lambda x: -15 * np.sqrt(1.0 - x**2) ** 3\n\n        self.lmax = self.mmax = 4\n\n        self.tol = 1e-9\n\n    def test_legendre(self):\n        print(\"Testing computation of associated Legendre polynomials\")\n        from paddle_harmonics.legendre import legpoly\n\n        t = np.linspace(0, 1, 100)\n        vdm = legpoly(self.mmax, self.lmax, t)\n\n        for l in range(self.lmax):\n            for m in range(l + 1):\n                diff = vdm[m, l] / self.cml(m, l) - self.pml[(m, l)](t)\n                self.assertTrue(diff.max() \u003c= self.tol)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfcclab%2Fpaddle_harmonics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfcclab%2Fpaddle_harmonics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfcclab%2Fpaddle_harmonics/lists"}