Code Monkey home page Code Monkey logo

n2n's People

Contributors

anubhavashok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

n2n's Issues

models download link

Hi, I'm unable to download the model using the link specified in the README. Can you please fix it?

student model need to finetune?

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

  1. def trainTeacherStudent()
  2. def trainTeacherStudentRand()
  3. def trainTeacherStudentNew()
  4. def trainTeacherStudentParallel()
    which one should I choose?

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!

the pre-trained model

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

student loss fine tuning

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

failure of controller saving

torch.save(controller, controllerSavePath) is used for saving the controller model, but it fails to save the model. The model file name is needed.

action.reinforce(avgR - b) can't be used

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?

A layer is Sequential() in cifar100_resnet18 stage1 model.

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.

actions.reinforce

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?

Download models - Link broken

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

lookup table values

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?

Reproduce the results in the paper from scratch

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!

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.