Code Monkey home page Code Monkey logo

topological-dvae's People

Contributors

yuki3-18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

topological-dvae's Issues

loss.backward()error

File "/homes/qinan/miniconda3/envs/3DUNet/lib/python3.6/site-packages/topologylayer/functional/sublevel.py", line 45, in backward
return None, grad_f.view(retshape).to(device), None, None
RuntimeError: shape '[256, 256, 96]' is invalid for input of size 58

sorry , when I use the loss function have the above error. Could you please give me some advices?
I change something to fit my model, the following is my code. But we I use the loss function in my train.py, loss.backward() have the above error.

def topological_loss(recon_x):
batch_size = recon_x.size(0)
b01, b0, b1, b2 = 0., 0., 0., 0.
cpx = init_tri_complex_3d(10, 10, 10๏ผ‰
layer = LevelSetLayer(cpx, maxdim=2, sublevel=False)
f01 = TopKBarcodeLengths(dim=0, k=1)
f0 = PartialSumBarcodeLengths(dim=0, skip=1)
f1 = SumBarcodeLengths(dim=1)
f2 = SumBarcodeLengths(dim=2)
for i in range(batch_size):
dgminfo = layer(recon_x.view(batch_size, patch_side, patch_side, patch_side)[i])
b01 += ((1. - f01(dgminfo))).sum()
b0 += (f0(dgminfo)).sum()
b1 += (f1(dgminfo)).sum()
b2 += (f2(dgminfo)).sum()
b01 = b01.div(batch_size)
b0 = b0.div(batch_size)
b1 = b1.div(batch_size)
b2 = b2.div(batch_size)
topo = b01 + b0 + b1 + b2
return topo

About input data

Hello, author
I am reproducing your paper currently, and I don't understand how to make the file'pytorch/vae/filename.txt' ? If it's convenient, just let me know. Thanks so much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.