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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Superxixixi/LoCoNet_ASD", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| 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) | |