Package: comvex
ComVEX: Computer Vision EXpoHi there! This is a reimplementation library for computer vision models byPyTorchandEinops. Our mission is to bridge papers and codes with consistent and clear implementations.What are the pros?Consistent StructureEvery models share similar building objects:xxxBase: A model's base. For checking common input arguments and storing important variables. Sometimes it can also provide specified weight initialization methods or necessary tensor operations, like patching and flattening images inViT.xxxBackbone: A model's backbone architecture. It includes every needed components to build the model except the classifier.xxxWithLinearClassifier:xxxBackboneplus a projection head as its classifier. Only acceptxxxConfigas its argument. Similar toHuggingface. Might provide some variants for differenet objective in the future.xxxConfig: A configuration for all possible coefficients. It also provides model specializations mentioned in the papers.Consistent Namings for papers and across papersTo make researchers or developers understand implementations as soon as possible, we tightly follow the names of model components from the official papers and be consistent on common namings across papers.Clear Tensor OperationsWe useEinopsfor almost all tensor operations to unveil the dimensions of tensors, which are usually hidden in the code, and make our implementations explain by themselves.Clear ArgumentsTo expose all possible arguments to users but still remain convenience, we categorize building objects into a hierarchical order with 3 levels listed from bottom to top as below:Basic: The paper-proposed and essential objects that mostly inherit directly fromnn.Moduleor otherBasicobjects, likeViTBase,MultiheadAttention,SpatialGatingUnit, etc.Wrapper: Intermediate objects or wrappers that organizeBasicones, likeTransformerEncoderLayer,PerceiverBlock,MLPMixerLayer,xxxWithLinearClassifier, etc.Model:xxxBackboneandxxxConfig.BasicandModelobjects are the ones crucial for paper-to-code mappings and model usages, so we require their arguments to be fully explicit to users (list all arguments in__init__methods). And for the sake of convenience,Wrapperobjects can useargsor**kwargsto pass down necessary arguments. The overall model structures in term of the number of required arguments will look like a hourglass.Semantic NamingExcluding some common names likexfor the input tensors,ff_dropoutfor the dropout rate of feed forward networks, andact_func_namefor a string of activation function's name supported byPyTorch, all variables, helper functions, and objects should be named meaningfully.Detailed Model InformationEvery models has its ownREADME.mdthat provides usages, one-by-one argument explanations, and all usable objects and specializations. The official implementations are provided as well if any mentioned in the official paper.How to install?pip3 install comvexHow to use?Please check out theUsagesection detailed in models' ownREADME.md.How to contribute?Please check out theCONTRIBUTING.mdfor details.NotesContinuously implementing models, please check them out under thecomvexfolder for more details andexamplesfolder for some demos.Pull requests are welcome!From thisissue, inheritance doesn't support intorchscript. Therefore, most of our implementations aren't scriptable. Buttraceseems that doesn't exist this kind of issue and we will usetraceas our default and gradually update our code to makeComVEXa trace-supported library.