This project incorporates code from TorchSSL, which is licensed under the MIT License.
The following is the full text of the MIT License as applied to TorchSSL: MIT License
Copyright (c) 2021 TorchSSL
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This is an PyTorch implementation of RegMixMatch. Note that all our baseline is based on the implementation of TorchSSL framework. We would like to thank the authors of this repository.
Before running or modifing the code, you need to:
- Clone this repo to your machine.
- Make sure Anaconda or Miniconda is installed.
- Run
conda env create -f environment.ymlorconda env create -f environment3090.ymlfor environment initialization, and activate environmentconda activate ssl.
As introduced in paper, we implement RegMixMatch based on FreeMatch [1]. If you want to run RegMixMatch algorithm:
- Modify the config file in
config/freematch_entropy/freematch_entropy_xx_xx_xx.yamlas you need - Run
python freematch_entropy.py --c config/freematch_entropy/freematch_entropy_xx_xx_xx.yaml
If you are interested in this project, we highly recommend using the USB benchmark to get the results, achieving better outcomes with less training time. You can replace the corresponding files with the files in the usb folder.
Subsequent experiments revealed that CAM does not consistently improve performance and may even lead to degradation in certain cases. Given the relatively limited gains and potential risks, we recommend keeping disab_cam=True throughout training for safety.
[1] Yidong Wang, Hao Chen, Qiang Heng, Wenxin Hou, Yue Fan, Zhen Wu, Jindong Wang, Marios Savvides, Takahiro Shinozaki, Bhiksha Raj, Bernt Schiele, Xing Xie. FreeMatch: Self-adaptive Thresholding for Semi-supervised Learning. ICLR, 2023.