code-soup icon indicating copy to clipboard operation
code-soup copied to clipboard

Refactoring

Open someshsingh22 opened this issue 4 years ago • 4 comments

Some tweaks and design changes

  • [x] Remove pre-trained models from init and call from libraries
  • [x] Remove pre-defined dataset implementation from torchvision
  • [x] Remove utils from chapters folder
  • [ ] Remove step Analogy from common models
  • [ ] Uniform Documentation
  • [ ] Remove Benchmark from Implemented Models and Attacks

@mehulrastogi can you recall anything else?

someshsingh22 avatar Aug 30 '21 11:08 someshsingh22

  • We do need to rename some of the folders for better representation.
  • Link this has good standards for python docs. We can discuss and decide accordingly

@someshsingh22 what do you mean by removing step analogy?

mehulrastogi avatar Aug 31 '21 05:08 mehulrastogi

@mehulrastogi Step analogy is good for iterative attacks, but for training normal modules like ResNet / NiN / AllConvNet it looks unnecessary. So we should use the torchvision's pattern for them

someshsingh22 avatar Aug 31 '21 20:08 someshsingh22

.code-soup/code_soup/
+-- common/ #Used across the package, parallel to glossary
|   |   +-- models/ #Commonly used models for eg GPT-2
|   |     +-- vision/
|   |     +-- text/ 
|   |     +-- rl/
|   |   +-- utils/ #Commonly used utils like accuracy metric etc
|   |   +-- dataset/ #Datasets used in the chapter
# For every chapter ->
+-- ch{Chapter_Number}/ #Code refering to a particular chapter
|   +-- attacks/ #Attackers or Defenders used in the chapter
|   |   +--{Name_of_Attack/Defense}.py
# There will be exactly one file pertaining to the agents.
# This is supposed to be parallel to the pseudcode in a book.
# Therefore only model states and step functions for attack/defense should be here

How is the above struc?

  • Deleted the utils from chapters.
  • Also now models have the 3 areas instead of the other way round. corresponding inits can have the package wide imports. Also this allows streamlined inclusion of any common files in utils (like the seeding)
  • renamed models to attacks. can include defence as another folder and import through init

mehulrastogi avatar Sep 01 '21 09:09 mehulrastogi

With my PR I majorly did some reorganization on the commons folder to package files together logically

The following tasks still need attention:-

  • [ ] Remove step Analogy from common models / attack
  • [ ] Uniform Documentation
  • [ ] Remove Benchmark from Implemented Models and Attacks

mehulrastogi avatar Sep 19 '21 05:09 mehulrastogi