[refactor] move rbm.torch → compat.torch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 08:36:21 +02:00
co-authored by Claude Sonnet 4.6
parent 3d235b4214
commit b41274c7a6
7 changed files with 90 additions and 83 deletions
+85 -77
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -32,7 +32,7 @@
"from rbm.model import Model\n", "from rbm.model import Model\n",
"from rbm.entity import Entity, EntityParams, TrainingParams\n", "from rbm.entity import Entity, EntityParams, TrainingParams\n",
"from rbm.matrix import Mat, np, rms_error_accu, sample_gaussian\n", "from rbm.matrix import Mat, np, rms_error_accu, sample_gaussian\n",
"from rbm.torch import Optimizer\n", "from compat.torch import Optimizer\n",
"from image.sub_image import SubImageExtract, SubImageCombine, normalize\n", "from image.sub_image import SubImageExtract, SubImageCombine, normalize\n",
"import math\n", "import math\n",
"import random" "import random"
+2 -2
View File
@@ -24,7 +24,7 @@
"from rbm.model import Model\n", "from rbm.model import Model\n",
"from rbm.entity import Entity, EntityParams, TrainingParams\n", "from rbm.entity import Entity, EntityParams, TrainingParams\n",
"from rbm.matrix import Mat, np, rms_error_accu\n", "from rbm.matrix import Mat, np, rms_error_accu\n",
"from rbm.torch import Optimizer\n", "from compat.torch import Optimizer\n",
"import math" "import math"
] ]
}, },
@@ -430,4 +430,4 @@
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 5 "nbformat_minor": 5
} }
+1 -1
View File
@@ -26,7 +26,7 @@
"from rbm.model import Model\n", "from rbm.model import Model\n",
"from rbm.entity import Entity, EntityParams, TrainingParams\n", "from rbm.entity import Entity, EntityParams, TrainingParams\n",
"from rbm.matrix import Mat, np, rms_error_accu\n", "from rbm.matrix import Mat, np, rms_error_accu\n",
"from rbm.torch import Optimizer\n", "from compat.torch import Optimizer\n",
"from image.sub_image import SubImageExtract\n", "from image.sub_image import SubImageExtract\n",
"import math" "import math"
], ],
+1 -1
View File
@@ -21,4 +21,4 @@ readme = "README.md"
[tool.setuptools] [tool.setuptools]
package-dir = {"" = "src"} package-dir = {"" = "src"}
packages = ["rbm", "image", "stack", "label"] packages = ["rbm", "image", "stack", "label", "compat"]
View File
-1
View File
@@ -38,4 +38,3 @@ class Optimizer:
grad = self.entity.grad_compute(dbv, dbh, dwhv) grad = self.entity.grad_compute(dbv, dbh, dwhv)
# Adjust weights # Adjust weights
self.entity.state_adjust(grad) self.entity.state_adjust(grad)