Skip to content

Instantly share code, notes, and snippets.

View beybars1's full-sized avatar
:electron:
coding.

Beybars Mussa beybars1

:electron:
coding.
View GitHub Profile
@L0SG
L0SG / freeze_example.py
Last active October 12, 2023 05:02
PyTorch example: freezing a part of the net (including fine-tuning)
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.optim as optim
# toy feed-forward net
class Net(nn.Module):
def __init__(self):