{"id":13532638,"url":"https://github.com/kamo-naoyuki/pytorch_complex","last_synced_at":"2025-05-08T21:08:44.573Z","repository":{"id":43659020,"uuid":"163291204","full_name":"kamo-naoyuki/pytorch_complex","owner":"kamo-naoyuki","description":"A temporal  module for PyTorch-ComplexTensor","archived":false,"fork":false,"pushed_at":"2024-06-28T07:10:19.000Z","size":116,"stargazers_count":45,"open_issues_count":1,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-20T11:07:01.487Z","etag":null,"topics":["complex-numbers","dnn","python","python3","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","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/kamo-naoyuki.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-27T12:20:22.000Z","updated_at":"2024-06-28T06:55:28.000Z","dependencies_parsed_at":"2024-10-26T21:18:13.524Z","dependency_job_id":null,"html_url":"https://github.com/kamo-naoyuki/pytorch_complex","commit_stats":{"total_commits":103,"total_committers":4,"mean_commits":25.75,"dds":"0.19417475728155342","last_synced_commit":"8a2ad1e47f3df25a30eb426f6ad781b89103fab3"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamo-naoyuki%2Fpytorch_complex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamo-naoyuki%2Fpytorch_complex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamo-naoyuki%2Fpytorch_complex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamo-naoyuki%2Fpytorch_complex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamo-naoyuki","download_url":"https://codeload.github.com/kamo-naoyuki/pytorch_complex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231311624,"owners_count":18356590,"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":["complex-numbers","dnn","python","python3","pytorch"],"created_at":"2024-08-01T07:01:12.488Z","updated_at":"2024-12-27T12:07:00.143Z","avatar_url":"https://github.com/kamo-naoyuki.png","language":"Python","funding_links":[],"categories":["Tools"],"sub_categories":["BSS/ICA method"],"readme":"# pytorch_complex\n\n[![PyPI version](https://badge.fury.io/py/torch-complex.svg)](https://badge.fury.io/py/torch-complex)\n[![Python Versions](https://img.shields.io/pypi/pyversions/torch-complex.svg)](https://pypi.org/project/torch-complex/)\n[![Downloads](https://pepy.tech/badge/torch-complex)](https://pepy.tech/project/torch-complex)\n[![Build Status](https://travis-ci.org/kamo-naoyuki/pytorch_complex.svg?branch=master)](https://travis-ci.org/kamo-naoyuki/pytorch_complex)\n[![codecov](https://codecov.io/gh/kamo-naoyuki/pytorch_complex/branch/master/graph/badge.svg)](https://codecov.io/gh/kamo-naoyuki/pytorch_complex)\n\nA temporal python class for PyTorch-ComplexTensor\n\n\n## What is this?\nA Python class to perform as `ComplexTensor` in PyTorch: Nothing except for the following,\n\n```python\nclass ComplexTensor: \n    def __init__(self, ...):\n        self.real = torch.Tensor(...)\n        self.imag = torch.Tensor(...)\n```\n\n### Why?\nPyTorch is great DNN Python library, except that it doesn't support `ComplexTensor` in Python level.\n\nhttps://github.com/pytorch/pytorch/issues/755\n\nI'm looking forward to the completion, but I need `ComplexTensor` for now.\n I created this cheap module for the temporal replacement of it. Thus, I'll throw away this project as soon as  `ComplexTensor` is completely supported!\n\n## Requirements\n\n```\nPython\u003e=3.6\nPyTorch\u003e=1.0\n```\n\n## Install\n\n```\npip install torch_complex\n```\n\n## How to use\n\n### Basic mathematical operation\n```python\nimport numpy as np\nfrom torch_complex.tensor import ComplexTensor\n\nreal = np.random.randn(3, 10, 10)\nimag = np.random.randn(3, 10, 10)\n\nx = ComplexTensor(real, imag)\nx.numpy()\n\nx + x\nx * x\nx - x\nx / x\nx ** 1.5\nx @ x  # Batch-matmul\nx.conj()\nx.inverse() # Batch-inverse\n```\n\nAll are implemented with combinations of computation of `RealTensor` in python level, thus the speed　is not good enough.\n\n\n### Functional\n\n```python\nimport torch_complex.functional as F\nF.cat([x, x])\nF.stack([x, x])\nF.matmul(x, x)  # Same as x @ x\nF.einsum('bij,bjk,bkl-\u003ebil', [x, x, x])\n```\n\n### For DNN\nAlmost all methods that `torch.Tensor` has are implemented. \n\n```python\nx.cuda()\nx.cpu()\n(x + x).sum().backward()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamo-naoyuki%2Fpytorch_complex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamo-naoyuki%2Fpytorch_complex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamo-naoyuki%2Fpytorch_complex/lists"}