Add files via upload

This commit is contained in:
David Rotermund 2024-06-01 02:14:18 +02:00 committed by GitHub
parent 6d86bb04bb
commit 7bcd733d3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import torch import torch
from NNMF2d import NNMF2d from NNMF2d import NNMF2d
from Y import Y
def make_optimize( def make_optimize(
@ -44,6 +45,13 @@ def make_optimize(
for netp in network[layerid].parameters(): for netp in network[layerid].parameters():
list_cnn.append(netp) list_cnn.append(netp)
if isinstance(network[layerid], Y):
for sublayer in network[layerid].segments:
for subsublayer in sublayer:
if isinstance(subsublayer, NNMF2d):
for netp in subsublayer.parameters():
list_nnmf.append(netp)
if isinstance(network[layerid], NNMF2d): if isinstance(network[layerid], NNMF2d):
for netp in network[layerid].parameters(): for netp in network[layerid].parameters():
list_nnmf.append(netp) list_nnmf.append(netp)

View file

@ -127,6 +127,7 @@ def main(
print(network) print(network)
( (
optimizer_nnmf, optimizer_nnmf,
optimizer_cnn, optimizer_cnn,