Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View codeeppy's full-sized avatar
🎯
Focusing

codeeppy

🎯
Focusing
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):