Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-xu committed Sep 9, 2020
1 parent a9584b7 commit 1bfa37f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions cifar.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
from __future__ import print_function

import torch
import torch.nn as nn
import argparse
import os.path as osp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

from sklearn.manifold import TSNE
from sklearn.decomposition import PCA

import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import matplotlib.pyplot as plt
import torchvision
import torchvision.transforms as transforms
from torch.optim import lr_scheduler

import os
import os.path as osp
import numpy as np
import argparse
from resnet import ResNet18
from utils import *
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA




Expand Down Expand Up @@ -82,6 +82,8 @@ def main():
for epoch in range(0, args.es):
print('\nEpoch: %d Learning rate: %f' % (epoch, optimizer.param_groups[0]['lr']))
train_features,train_labels = train( optimizer, net, trainloader, criterion)
fea, label = embedding(train_features, train_labels, select_train)
plot_features(fea, label, 10, epoch, 'train/')
# embedding(train_features, train_labels, select_train)
test_features, test_labels = test(net,testloader,criterion)
fea, label = embedding(test_features, test_labels, select_test)
Expand Down

0 comments on commit 1bfa37f

Please sign in to comment.