Instructions to use Superxixixi/LoCoNet_ASD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Superxixixi/LoCoNet_ASD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Superxixixi/LoCoNet_ASD", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Superxixixi/LoCoNet_ASD", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download utils/model_utils.py from Superxixixi/LoCoNet_ASD: direct link, hf CLI and curl.
- Browser
- Download file 682 Bytes
-
https://huggingface.co/Superxixixi/LoCoNet_ASD/resolve/refs%2Fpr%2F1/utils/model_utils.py
- Command line
-
hf download hf://Superxixixi/LoCoNet_ASD@refs/pr/1/utils/model_utils.py
-
curl -L -o model_utils.py https://huggingface.co/Superxixixi/LoCoNet_ASD/resolve/refs%2Fpr%2F1/utils/model_utils.py
682 Bytes
| def set_bn_eval(m): | |
| classname = m.__class__.__name__ | |
| if classname.find('BatchNorm') != -1: | |
| m.eval() | |
| def set_bn_non_trainable(m): | |
| classname = m.__class__.__name__ | |
| if classname.find('BatchNorm') != -1: | |
| m.weight.requires_grad = False | |
| m.bias.requires_grad = False | |
| def freeze_bn_statistics(model): | |
| """freeze the statistic mean and variance in BN | |
| Args: | |
| model (nn.Module): The model to be freezed statistics. | |
| """ | |
| model.apply(set_bn_eval) | |
| def freeze_bn_parameters(model): | |
| """ | |
| Args: | |
| model (nn.Module): The model to be freezed statistics. | |
| Returns: TODO | |
| """ | |
| model.apply(set_bn_non_trainable) | |