Skip to content
This repository has been archived by the owner on Sep 24, 2023. It is now read-only.

Found 2 bugs in declaring hidden sizes #46

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2779e13
Commented momentarily some files for better understanding of the code
davide-giacomini Jan 8, 2023
7b5e836
Updated gitignore for VSCode
davide-giacomini Jan 8, 2023
516ba89
First trial of quantization
davide-giacomini Jan 8, 2023
eba7a79
Added to the models saved the number of patches, the number of quanti…
davide-giacomini Jan 8, 2023
9340de4
Cleaned code that I added for debugging
davide-giacomini Jan 9, 2023
cd38271
Cleaned code for quantization
davide-giacomini Jan 9, 2023
373c942
Cleaned quantization code
davide-giacomini Jan 9, 2023
986da84
Changed gitignore because jupyter is of no use for the project
davide-giacomini Jan 10, 2023
4cb8757
Formula taken from the paper
davide-giacomini Jan 10, 2023
7c3ee72
Added phi quantization (patch vector)
davide-giacomini Jan 18, 2023
6a30d1d
Ht Relu limited to max=1
davide-giacomini Jan 18, 2023
db51f2f
Quantized lt
davide-giacomini Jan 18, 2023
40564df
Added possibility to quantize only in inference
davide-giacomini Jan 20, 2023
d82e74b
Changed gitignore
davide-giacomini Jan 22, 2023
881d1a5
Added checkpoints from colab
davide-giacomini Jan 22, 2023
0f51e40
Merged colab and local checkpoints
davide-giacomini Jan 22, 2023
55de70e
Updated 20_2x2_8_2_0_0_0_1
davide-giacomini Jan 22, 2023
1b7246d
Updated local checkpoints completed until 01/23
davide-giacomini Jan 23, 2023
45bccf7
Updated colab checkpoints until 01/23
davide-giacomini Jan 23, 2023
ff20088
merged colab and local checkpoints completed until 01/23
davide-giacomini Jan 23, 2023
b6b03fb
forgot these checkpoints
davide-giacomini Jan 23, 2023
159b0a4
Updated local checkpoints until morning 01/23
davide-giacomini Jan 23, 2023
7b35a58
Updated colab checkpoints completed until morning 01/23
davide-giacomini Jan 23, 2023
0adecc0
Bug issue: inverted loc_hidden and glimpse_hidden
davide-giacomini Jan 23, 2023
e5807a7
Bu Issue: the CoreNetwork input_size was wrong
davide-giacomini Jan 23, 2023
549a245
Fixed bugs of hidden_size and input parameters in trainer and model
davide-giacomini Jan 23, 2023
3131263
Just a simple comment
davide-giacomini Jan 23, 2023
39f910f
Added an hidden layer to the rnn network
davide-giacomini Jan 23, 2023
c027dc1
Changed checkpoint directory for 1hidden more
davide-giacomini Jan 23, 2023
7eed6fb
Update local ckpts 1hidden
davide-giacomini Jan 24, 2023
dc042f3
Updated local ckpt 1hidden
davide-giacomini Jan 24, 2023
9b5eb7d
Updated local changes ckpt_1hidden
davide-giacomini Jan 24, 2023
2df8338
Updated local ckpt 1hidden
davide-giacomini Jan 24, 2023
f61619a
Changed the directory in config.py
davide-giacomini Jan 25, 2023
05a924e
Changed name of directory for ckpt 1hidden 64
davide-giacomini Jan 25, 2023
d8cfcd9
L_t has never been quantized. I always quantized l_out, and I have to…
davide-giacomini Jan 25, 2023
879458f
Local 1hidden checkpoints updated
davide-giacomini Jan 26, 2023
4861eb7
Created code for saving everything in a csv file
davide-giacomini Jan 26, 2023
cf8e062
Created code for saving max and min phi
davide-giacomini Jan 30, 2023
5a14e8a
Saved local ckpts for the graphs
davide-giacomini Jan 30, 2023
1fbffc9
Merge branch '1hidden_more' into 1hidden_more_saving_phi_max_min
davide-giacomini Jan 30, 2023
d7a466f
Bug fixed in saving the location in the csv file
davide-giacomini Jan 31, 2023
b22977a
Now there are no more negative numbers in the csv file
davide-giacomini Jan 31, 2023
a08702a
Merge branch '1hidden_more' into 1hidden_more_saving_phi_max_min
davide-giacomini Jan 31, 2023
16082fe
Cleaned code for saving maximum and minimum of phi
davide-giacomini Jan 31, 2023
a3871a6
Merge branch '1hidden_more_saving_phi_max_min' into 1hidden_more
davide-giacomini Jan 31, 2023
f392f99
Prepared code for using phi max and min pre-calculated for the inference
davide-giacomini Jan 31, 2023
6b9eb4f
Cleaned code
davide-giacomini Jan 31, 2023
dbd00fa
Fixed bug which prenvented me to use cuda
davide-giacomini Jan 31, 2023
f25ec1b
Changed config directory for the new formula quantization formula
davide-giacomini Jan 31, 2023
3f52bdc
Updated ckpts with normal quantization
davide-giacomini Jan 31, 2023
c97aaa7
Fixed max and min of ht when quantized. So we have fixed steps
davide-giacomini Feb 1, 2023
0cdf91f
Added script to convert the training_table into an inference_table
davide-giacomini Feb 4, 2023
40cb760
Added memory_based_inference first draft
davide-giacomini Feb 4, 2023
edd25b4
Fixed bugs in synth_inference_table.py
davide-giacomini Feb 5, 2023
67a3160
Cleaned synth_inference_table.py
davide-giacomini Feb 5, 2023
098880b
Now I have a way from config to build the training table and also to …
davide-giacomini Feb 5, 2023
db3f05f
Changed the code in utils.py for using the gpu
davide-giacomini Feb 6, 2023
e3a6525
Added the possibility of doing baysean optimization
davide-giacomini Feb 7, 2023
7bdcc2e
Cleaned code with BO
davide-giacomini Feb 8, 2023
a8e1e1e
Updated distance function with Manhattan distance
davide-giacomini Feb 8, 2023
77a3674
I duplicated a lot of code to be able to automate the trials for BO
davide-giacomini Feb 9, 2023
d8914f2
When there are all the coefficients I don't use pow(2*d), but only ab…
davide-giacomini Feb 9, 2023
9c371ba
Config file cleaned
davide-giacomini Feb 13, 2023
c9079d9
updated server ckpts config 5_4x4_4_4_0_0_2_0
davide-giacomini Feb 14, 2023
62631b4
merge server with local
davide-giacomini Feb 14, 2023
d210060
Cleaned name of training table and updated gitignore for specific files
davide-giacomini Feb 16, 2023
1f3d973
Changed the code to only use manhattan distance without power coeffic…
davide-giacomini Feb 16, 2023
48c3ee8
Added noise coeeficient
davide-giacomini Feb 16, 2023
f03cf9e
Put every checkpoint under the same directory and added the indicator…
davide-giacomini Feb 17, 2023
f3488e8
Automated the read from file of phi_max and phi_min
davide-giacomini Feb 17, 2023
2877971
Created a script to generate plots. I still have to finish it
davide-giacomini Feb 17, 2023
8a15040
Created code for generating the plot of size_ht
davide-giacomini Feb 17, 2023
42effad
Generalized `generate_plot`
davide-giacomini Feb 17, 2023
4311082
Finished the generation of plots semi-automatic
davide-giacomini Feb 18, 2023
11abbb2
Removed prova.py from remote repository
davide-giacomini Feb 18, 2023
a7bb744
Fixed bug quantization phi
davide-giacomini Feb 23, 2023
0f4b8ed
Bug fixed in padding the input image
davide-giacomini Feb 24, 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
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
self.std = std

self.sensor = modules.GlimpseNetwork(h_g, h_l, g, k, s, c)
self.rnn = modules.CoreNetwork(hidden_size, hidden_size)
self.rnn = modules.CoreNetwork(h_g + h_l, hidden_size)
self.locator = modules.LocationNetwork(hidden_size, 2, std)
self.classifier = modules.ActionNetwork(hidden_size, num_classes)
self.baseliner = modules.BaselineNetwork(hidden_size, 1)
Expand Down
3 changes: 2 additions & 1 deletion modules.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
Expand Down Expand Up @@ -84,7 +85,7 @@ def extract_patch(self, x, l, size):
end = start + size

# pad with zeros
x = F.pad(x, (size // 2, size // 2, size // 2, size // 2))
x = F.pad(x, (math.ceil(size/2), math.ceil(size/2), math.ceil(size/2), math.ceil(size/2)))

# loop through mini-batch and extract patches
patch = []
Expand Down
2 changes: 1 addition & 1 deletion trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def __init__(self, config, data_loader):
self.num_patches,
self.glimpse_scale,
self.num_channels,
self.loc_hidden,
self.glimpse_hidden,
self.loc_hidden,
self.std,
self.hidden_size,
self.num_classes,
Expand Down