Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milestone 2 second tt ode working version backward gradient descent #18

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0525ea3
modify noise param to >0.0 so that we don't have err : Expected param…
mbaddar1 Aug 14, 2022
3774ca7
modify noise param to >0.0 so that we don't have err : Expected param…
mbaddar1 Aug 14, 2022
74a7f5d
regenerate same results for NODE on 1d flipped -1 1 problem with a s…
mbaddar1 Aug 31, 2022
d7a9119
start anode 3d viz preparation
mbaddar1 Sep 3, 2022
1ee699c
started sphere expeirment inspection
mbaddar1 Sep 13, 2022
8903839
compete code snippet for neurode 2d
mbaddar1 Sep 14, 2022
50cc5ca
started tde model
mbaddar1 Sep 25, 2022
e5604b4
first tde model attempt , dA/dt = U.A with no non-linearity . F fun i…
mbaddar1 Sep 29, 2022
aa472be
torch ode start : simple euler
mbaddar1 Oct 5, 2022
54a612d
added test cases, but for the lotkavolterra eqn seems that euler is h…
mbaddar1 Oct 5, 2022
29bfb79
finished first version of torch rk45 with testing
mbaddar1 Oct 12, 2022
628d1d4
added more Matalb based test cases
mbaddar1 Oct 13, 2022
29baaeb
bulk changes rollout
mbaddar1 Oct 13, 2022
8ef87b4
my toy neural ode with torch ode rk45 implementation
mbaddar1 Oct 13, 2022
4a8323e
changes to support cuda , needs more fixing
mbaddar1 Oct 18, 2022
27ae82b
Test modifications to work with GPU tesnors
mbaddar1 Oct 19, 2022
cfb2f05
my torch ode toy problem
mbaddar1 Oct 19, 2022
78203ed
bulk changes to make toy example and test cases with torch rk45 on GPU
mbaddar1 Oct 19, 2022
12b50ca
some bulk changes
mbaddar1 Oct 20, 2022
3d83ad6
set experimentation logging code
mbaddar1 Oct 20, 2022
0576990
add nfe computations , need to check it against the NODE paper
mbaddar1 Oct 20, 2022
5e7eea2
reengineered the training class to store NFE and average NFE
mbaddar1 Oct 21, 2022
7064359
--amend
mbaddar1 Oct 23, 2022
cc85530
add true and trainable dynamics
mbaddar1 Oct 23, 2022
6187928
separate data-gen learnbale-dynamics true-dynamics in own scripts
mbaddar1 Oct 24, 2022
3761da9
testing my Learnable TensorODE vs ResNET NODE and ANODE
mbaddar1 Oct 24, 2022
c445461
setup models experimentation framework;
mbaddar1 Oct 25, 2022
edeedef
add modifications to yaml file and support to concentric-sphere datas…
mbaddar1 Oct 26, 2022
2772621
modifications for makeing concentric sphere dataet work
mbaddar1 Oct 26, 2022
b13bee2
add early stop and shell experiment file to repeat
mbaddar1 Oct 27, 2022
08d7f0e
add shell script to run on experiment several times
mbaddar1 Oct 27, 2022
3929ed7
adding poly basis function to A but the solver stuck at some point du…
mbaddar1 Oct 30, 2022
1eb2aaa
add sin/cos basis fn - did not work
mbaddar1 Oct 31, 2022
d34af71
reimplement poly basis via torch vmap but not tested yet
mbaddar1 Nov 2, 2022
af0d9b1
reverted back to loop based application to solve / forward over batch…
mbaddar1 Nov 4, 2022
fc99843
initial results documentation
mbaddar1 Nov 8, 2022
e700315
simplifying nfe calculations and updating expermeints journal accordi…
mbaddar1 Nov 10, 2022
d474c75
retrying adding poly basis support
mbaddar1 Nov 15, 2022
d8e8094
first working version for TODE with poly_deg = 1
mbaddar1 Nov 16, 2022
1dc66dd
added support to select forward-integrate impl from mytorch and torch…
mbaddar1 Nov 16, 2022
a07e92c
solved exploding gradient problem by adding weight regularization. Th…
mbaddar1 Nov 18, 2022
be60c9d
adding non linearity in the final function
mbaddar1 Nov 21, 2022
1cf68fc
simplify final function
mbaddar1 Nov 23, 2022
5179513
start fixed tt contract code
mbaddar1 Dec 6, 2022
aa486b6
start tt work
mbaddar1 Jan 5, 2023
71c73b2
first attempt with TT as Coeff(W) for da/dt = W.phi(a). Plus other ch…
mbaddar1 Jan 6, 2023
cbd3fe1
Milestone 1 : First Working version of ttode with ordinary forward-ba…
mbaddar1 Jan 8, 2023
8d770dc
change forward overall impl and TTALS_apply also, to embed z0=P.x in it
mbaddar1 Jan 18, 2023
58f0405
skeleton for forward ttals with dummy backward : only termina_nn weig…
mbaddar1 Jan 19, 2023
6b35a2c
add dlra as submodule
mbaddar1 Jan 24, 2023
f0c341d
start integrate dlra david tt structure to the TTODE code
mbaddar1 Jan 29, 2023
c8acd80
integrate tt als for forward pass , very slow
mbaddar1 Jan 31, 2023
2fb7a4a
First try to integrate tt-als , problem is that W ( the coeff TT) is …
mbaddar1 Feb 3, 2023
c89c9c1
simple TT regression problem to test TT-ALS vs TT-Gradient Descent
mbaddar1 Feb 5, 2023
535b465
modify nn seq model norm
mbaddar1 Feb 5, 2023
a076365
wokring version of a simple TT-grad problem
mbaddar1 Feb 8, 2023
2b5392d
Milestone 2 : first semi working version of dlra-david TT class with …
mbaddar1 Feb 8, 2023
78d121d
Milestone 2 : First Working version with dlra.TT class with torch_int…
mbaddar1 Feb 9, 2023
686e5dd
Merge pull request #1 from mlguy101/experiments
mbaddar1 Feb 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Milestone 2 : First Working version with dlra.TT class with torch_int…
…egrate for forward pass, and backward is implemented implicited via pytorch backward gradient descent (Adam)
  • Loading branch information
mbaddar1 committed Feb 9, 2023
commit 78d121d0f0e9eab895712d0fc4e318391eaf1300
4 changes: 2 additions & 2 deletions phd_experiments/tt_ode/ttode_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ train:
print_freq: 10
loss: "smoothl1loss"
loss_window: 10
loss_threshold: 1e-4 # must be adjusted based on dataset
loss_threshold: 1e-3 # must be adjusted based on dataset

# 6 ) Model-specific params
resnet:
Expand Down Expand Up @@ -60,7 +60,7 @@ ttode: # tensor ode
# TODO Understand : why when tf is large (e.g. 10) we get underflow
# TODO more experiment with tf : seems crucial to accuracy and running time
forward_impl_method: "ttode_als"
custom_autograd_fn : True
custom_autograd_fn : False
lambda : 0.1 # TODO make it fn (Coeff tensor order)
tt_rank : 5

25 changes: 0 additions & 25 deletions phd_experiments/tt_ode/ttode_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,31 +154,6 @@ def get_loss(loss_name: str):
W_old_norm = get_W_norm(model_.get_W())
Q_old_norm = model_.get_Q().norm().item()

# update via gradient descent for parameters with required_grad=True
# FIXME , hack to amplify W grads
if isinstance(model_.get_W(), list) and all([isinstance(w, TensorTrain) for w in model_.get_W()]):
for w in model_.get_W():
for G in w.comps:
G.grad *= 1
# FIXME End hack

# FIXME , remove quick hack to manual compute parameters update and see how that compares to optimize steps
# P_new_manual = model_.get_P()-float(configs_['train']['lr'])* model_.get_P().grad
# FIXME hack , manually update W components till we find why it is not updated
# W = model_.get_W()
# # https://medium.com/@mrityu.jha/understanding-the-grad-of-autograd-fc8d266fd6cf
# if isinstance(W, TensorTrainFixedRank):
# pass
# elif isinstance(W, list) and all([isinstance(w, TensorTrain) for w in W]):
# for i, w in enumerate(model_.get_W()):
# for j, G in enumerate(w.comps):
# is_leaf = G.is_leaf
# model_.get_W()[i].comps[j] -= float(configs_['train']['lr']) * model_.get_W()[i].comps[j].grad

# TODO
# 1. Understand why optimizer step doesn't update W even when W Grads are good enough ??
# 2. Emulate optimize.step with wit

optimizer.step()

# calculate delta norm
Expand Down
3 changes: 0 additions & 3 deletions phd_experiments/tt_ode/ttode_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ def __init__(self, input_dimensions: List[int], output_dimensions: List[int],
P_dims.extend(tensor_dimensions.copy())
assert len(P_dims) == 2, "No support for the projection tensor P with n_dims > 2 , yet !"

# F_dims = tensor_dimensions.copy()
# F_dims.extend(output_dimensions.copy())

# initialize model parameters

# Initialize P
Expand Down