Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
remove maplotlib inline configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
keon committed Aug 18, 2019
1 parent 262b465 commit 2e0ef13
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# 우리의 목표는 오염된 이미지와 weird_function()의 코드만을 가지고 원본 이미지 파일을 복원하는 것입니다.
# *참고자료: https://github.com/jcjohnson/pytorch-examples, NYU Intro2ML*

get_ipython().run_line_magic('matplotlib', 'inline')

import torch
import pickle
import matplotlib.pyplot as plot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# # 4.1 Fashion MNIST 데이터셋 알아보기

get_ipython().run_line_magic('matplotlib', 'inline')

from torchvision import datasets, transforms, utils
from torch.utils import data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import numpy as np
get_ipython().run_line_magic('matplotlib', 'inline')



torch.manual_seed(1) # reproducible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import numpy as np
get_ipython().run_line_magic('matplotlib', 'inline')



torch.manual_seed(1) # reproducible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import torch.nn.functional as F
import random

get_ipython().run_line_magic('matplotlib', 'inline')



vocab_size = 256 # 총 아스키 코드 개수
Expand Down
2 changes: 1 addition & 1 deletion 08-딥러닝_해킹하기/01-fgsm-attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import json


get_ipython().run_line_magic('matplotlib', 'inline')

import matplotlib.pyplot as plt


Expand Down
2 changes: 2 additions & 0 deletions compile_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def main():
exporter = ScriptExporter()
cell_pattern = "#\s(In)\[(.*)\]:\n\n\n" # # In [*]:
comment_pattern = "(#(\s*)\n)"
matplotlib_pattern = "(.*get_ipython.*)"

for nbpath in glob.iglob('**/*.ipynb', recursive=True):
base, ext = os.path.splitext(nbpath)
Expand All @@ -31,6 +32,7 @@ def main():
# remove unecessary patterns
script = re.sub(cell_pattern, "", script)
script = re.sub(comment_pattern, "", script)
script = re.sub(matplotlib_pattern, "", script)
pypath = (base + resources.get('output_extension', '.txt'))
print("Saving script %s" % pypath)
with io.open(pypath, 'w', encoding='utf-8') as f:
Expand Down

0 comments on commit 2e0ef13

Please sign in to comment.