Giter Club home page Giter Club logo

Comments (6)

rtqichen avatar rtqichen commented on July 21, 2024 4

Yes, this is on a TODO for now. https://github.com/rtqichen/torchdiffeq/blob/master/torchdiffeq/_impl/adjoint.py#L31
I'd need to get a bit finicky with pytorch's Function.

For now, I think the non-adjoint version should support higher-order autodiffs.

from torchdiffeq.

Sceki avatar Sceki commented on July 21, 2024 1

Hi @rtqichen, thank you for your work! So how can we currently take high order gradients of the integration outputs with respect to the inputs (e.g. initial conditions or else)?

from torchdiffeq.

EyalRozenberg1 avatar EyalRozenberg1 commented on July 21, 2024

Hello @rtqichen.
Was there a progress in higher order autodiff feature using the adjoint method?

from torchdiffeq.

rtqichen avatar rtqichen commented on July 21, 2024

No sorry, zero progress has been made since 2019. If anyone wants to submit a PR for this, I can approve it.

from torchdiffeq.

EyalRozenberg1 avatar EyalRozenberg1 commented on July 21, 2024

Thanks for your comment, Ricky.
Are there any action items that should be taken?
Eyal

from torchdiffeq.

wangmiaowei avatar wangmiaowei commented on July 21, 2024

@rtqichen Thanks for your work. But The GPU memory is lost when I use
import torch.autograd as ag.
My code is as follows:

for itr in range(1, 5):
        print('iteration: ',itr)
        print("start_memory_allcoated(MB) {}".format(torch.cuda.memory_allocated()/1048576))
        optimizer.zero_grad()
        batch_y0, batch_t, batch_y = get_batch()
        batch_y0.requires_grad  = True
        print('batch_y0.shape: ',batch_y0.shape)
        pred_y = odeint(func, batch_y0, batch_t).to(device)
        

My results are as follows:

iteration:  1
start_memory_allcoated(MB) 0.0146484375
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.0244140625
iteration:  2
start_memory_allcoated(MB) 0.0244140625
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.025390625
iteration:  3
start_memory_allcoated(MB) 0.025390625
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.0263671875
iteration:  4
start_memory_allcoated(MB) 0.0263671875
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.02734375
(base) [s2608314@node3c01(eddie) networks]$ python test.py
iteration:  1
start_memory_allcoated(MB) 0.0146484375
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.0244140625
iteration:  2
start_memory_allcoated(MB) 0.0244140625
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.025390625
iteration:  3
start_memory_allcoated(MB) 0.025390625
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.0263671875
iteration:  4
start_memory_allcoated(MB) 0.0263671875
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.02734375
iteration:  5
start_memory_allcoated(MB) 0.02734375
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.0283203125
iteration:  6
start_memory_allcoated(MB) 0.0283203125
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.029296875
iteration:  7
start_memory_allcoated(MB) 0.029296875
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.0302734375
iteration:  8
start_memory_allcoated(MB) 0.0302734375
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.03125
iteration:  9
start_memory_allcoated(MB) 0.03125
batch_y0.shape:  torch.Size([20, 1, 2])
end_memory_allcoated(MB) 0.0322265625

And it really causes out of memory! Hope to get your reply as soon as possible.

from torchdiffeq.

Related Issues (20)

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.