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

How to acquire CHAMP module. #1

Open
sekigh opened this issue Sep 30, 2020 · 8 comments
Open

How to acquire CHAMP module. #1

sekigh opened this issue Sep 30, 2020 · 8 comments

Comments

@sekigh
Copy link

sekigh commented Sep 30, 2020

I am interested in running Annex.ipynb on jupyter lab but fail in the middle because I can not locate CHAMP module. This CHAMP looks unrelated with champ on the github https://github.com/wweir827/CHAMP. Am I right? How do I get the right Champ ? Thank you.

@laurentperrinet
Copy link
Collaborator

hi!

indeed, this repository was in "private" mode. It is now fixed, you can get it @ https://github.com/VictorBoutin/CHAMP

(it has been a while since I have not looked at that code - hope everything still runs fine! :-) )

cheers,
Laurent

@sekigh
Copy link
Author

sekigh commented Sep 30, 2020

Hi,

Thank you for your quick response. Yes, I can install CHAMP but I find that Raw DataBase is missing. The code says an error as follows:

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/database/Face_DataBase/Raw_DataBase'

Is it possible to share that data for code sanity check purpose ?

Thank you.

@laurentperrinet
Copy link
Collaborator

you certainly miss the data which is normally imported through torchvision. when using LoadDatabe sure to set download=True

@VictorBoutin
Copy link
Collaborator

VictorBoutin commented Sep 30, 2020 via email

@sekigh
Copy link
Author

sekigh commented Sep 30, 2020

Hi Victor,

Thank you for your response. Unfortunately, the link to face data, shown on the page of ATT http://cam-orl.co.uk/facedatabase.html is not available any longer. It is disconnected or removed. It is because the ATT link page looks old (created in 2001. The data are now missing.

Hi Laurent,
According to Victor, these data does not look to be included in torchvision. There is CelebA face in torchvision but they are of course different from data you used in the annex. I changed the LoadData argument with download=True, but I failed.

Is there any suggestion to retrieve the data back for code check ?
I really want to see how the SHL is incorporated in neural network like CNN.

Best regards,

Hiroshi Sekiguchi

@VictorBoutin
Copy link
Collaborator

VictorBoutin commented Sep 30, 2020 via email

@sekigh
Copy link
Author

sekigh commented Sep 30, 2020

Hi Victor,

Thank you for url to database. I will import them to the codes.

Best regards,

Hiroshi

@sekigh
Copy link
Author

sekigh commented Sep 30, 2020

Hi,
I am in the situation to debug codes.
It succeeded in reading Raw_DataBase and executed computation up to the 3rd-2nd line to the last of a part of the codes attached below.;

dico_mask = L1_mask.TrainLayer(
Filtered_L_TrSet, eta=eta, eta_homeo=eta_homeo, nb_epoch=nb_epoch, seed=seed)

Then the last statement of a part of codes;

SaveNetwork(Network=L1_mask, saving_path=ffname)

faces an error as follows: FileNotFoundError: [Errno 2] No such file or directory: 'cache_dir_CNN/CHAMP_low_None.pkl'

I looked into the codes carefully and found no statement to create a folder/file for "cache_dir_CNN/CHAMP_low_None.pkl" before. So it is reasonable to have an error. I am not sure how it ends up with such as this. Any comments are welcome.


< A part of the codes having an error: >

sys.path.append('/home/sekigh/Windowsfolder/HULK/CHAMP')

from CHAMP.DataLoader import LoadData
from CHAMP.DataTools import LocalContrastNormalization, FilterInputData, GenerateMask
from CHAMP.Monitor import DisplayDico, DisplayConvergenceCHAMP, DisplayWhere

import os
datapath = os.path.join("/tmp", "database")
path = os.path.join(datapath, "Face_DataBase/Raw_DataBase")
TrSet, TeSet = LoadData('Face', path, decorrelate=False, resize=(65, 65))

MP Parameters

nb_dico = 20
width = 9
dico_size = (width, width)
l0 = 20
seed = 42

Learning Parameters

eta = .05
nb_epoch = 500

TrSet, TeSet = LoadData('Face', path, decorrelate=False, resize=(65, 65))
N_TrSet, _, _, _ = LocalContrastNormalization(TrSet)
Filtered_L_TrSet = FilterInputData(
N_TrSet, sigma=0.25, style='Custom', start_R=15)

mask = GenerateMask(full_size=(nb_dico, 1, width, width), sigma=0.8, style='Gaussian')

from CHAMP.CHAMP_Layer import CHAMP_Layer

from CHAMP.DataTools import SaveNetwork, LoadNetwork
homeo_methods = ['None', 'HAP']

for homeo_method, eta_homeo in zip(homeo_methods, [0., 0.0025]):
ffname = 'cache_dir_CNN/CHAMP_low_' + homeo_method + '.pkl'
try:
L1_mask = LoadNetwork(loading_path=ffname)
except:
L1_mask = CHAMP_Layer(l0_sparseness=l0, nb_dico=nb_dico,
dico_size=dico_size, mask=mask, verbose=1)
dico_mask = L1_mask.TrainLayer(
Filtered_L_TrSet, eta=eta, eta_homeo=eta_homeo, nb_epoch=nb_epoch, seed=seed)
SaveNetwork(Network=L1_mask, saving_path=ffname)

< End of a part of the codes>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants