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
@beybars1
beybars1 / freeze_example.py
Created November 18, 2021 16:55 — forked from L0SG/freeze_example.py
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):