anubhavashok / n2n Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hi, I'm unable to download the model using the link specified in the README. Can you please fix it?
Hi, Thank you for your advice. I get accuracy 92.01 of teacher model. And I still have a question.
When training the students model in stage 1,there are many function to choose as I list below
I notice that these function hase different loss function. after training with function 4(def trainTeacherStudentParallel) in stage 1, the student model I got is not as good as the student model in the paper.Whether finetune is required?
thank you!
which framwork is the pre-trained model trained? pytorch or caffe, and how can i train a teacher model by myself? such as res50 and densenet @anubhavashok
I use cifar10_old and resnet18 to achieve acc=92.01% .After stage1 training ,the best acc is 85.81%.The model_6_2 gets the best result.I see your answer of the other questions. I know Student Loss need to change. Whether it's this loss = MSEloss(studentOutput, teacherOutput) in this funtion trainTeacherStudentParallel that needs to change. Should it be changed into loss=MSEloss + rc*ra
torch.save(controller, controllerSavePath) is used for saving the controller model, but it fails to save the model. The model file name is needed.
Due to version problems
the code
if isinstance(actions, list):
for action in actions:
action.reinforce(avgR - b)
else:
actions.reinforce(avgR - b)
actionloss=actionloss.mean()
has error.
I use this code
if isinstance(actions, list):
for action in actions:
m=torch.distributions.Categorical(probs)
actionloss=-m.log_prob(action)*(avgR-b)
else:
m = torch.distributions.Categorical(probs)
actionloss = -m.log_prob(actions) * (avgR - b)
to instead of it.
Do these two pieces of code have the same meaning?How do I replace it if it's not the same?
Hi, there. When I run
python run.py shrinkage cifar100 teacher_models/resnet18_cifar100.net --model student_models/cifar100_resnet18_stage1.net --cuda True
using the teacher-model and student-model you provided. There is a error as follows:
Testing parent model to determine baseline accuracy
predicted 6732 out of 10000
accuracy = 67.32
Traceback (most recent call last):
File "run.py", line 147, in <module>
(Rs, actionSeqs, models) = rollouts(N, model, controller, architecture, dataset, e, size_constraint=size_constraint, acc_constraint=acc_constraint)
File "/home/zlq/code/N2N/rl.py", line 126, in rollouts
(Rs, actionSeqs, models) = rollout_batch(copy.deepcopy(model), controller, architecture, dataset, N, e, acc_constraint=acc_constraint, size_constraint=size_constraint)
File "/home/zlq/code/N2N/rl.py", line 94, in rollout_batch
actions = controller.rolloutActions(layers)
File "/home/zlq/code/N2N/rl.py", line 51, in rolloutActions
**input[i] = Layer(layers[i]).toTorchTensor(skipSupport=self.skipSupport)**
File "/home/zlq/code/N2N/Layer.py", line 8, in __init__
self.type = getLayerType(layer)
File "/home/zlq/code/N2N/utils.py", line 269, in getLayerType
return max(layerTypes.index(name), 0)
ValueError: 'Sequential' is not in list
I found input[i]
is Sequential()
in stead of a centain layer. I wonder where it comes from and how to fix it.
Dear author, hello, when I was reading the code, I found that some files seemed to be missing, such as "actions.reinforce" (in rl.py) above the title. Could you please help me take a look?
Hello,
The link to download teacher and student models is not working - the models are not available to outside users. Please look into that.
Thanks
Harshvardhan
Would you mind adding a preferred bibtex entry to your readme.md for citing you?
CIFAR-10 resnet18 teacher model accuracy is 92.01 in the paper. I download resnet18_best.net from the link of teacher model, the accuracy is 88.99. is it the best model of resnet18 in the paper?
Thanks
lookup = [0.25 , .5, .5, .5, .5, .5, .6, .7, .8, .9, 1.] is the layer shrinkage parameters in the code. This is not the same as the description in the paper. Would you please explain the difference?
Hello,
Is there any script to reproduce the results in the paper "from scratch"? That is, don't use pre-trained teacher and controller. Can you provide some scripts to do this?
Thank you very much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.