Instantly share code, notes, and snippets.

View Dumpling_heat_transient.py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
# param
k = 1.15
c = 4200
p = 5013
dx = 0.001
View FizzBuzz_keras.py
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense
import tensorflow as tf
n = 1000
model_file = 'fizzbuzz_keras.h5'
valid_n = 100
View Decision_stump.py
import numpy as np
np.set_printoptions(2)
dataY = np.array([1, -1, 1, 1, 1,
-1, -1, 1, -1, -1])
dataX = np.arange(len(dataY))
print('X ', dataX)
print('Y ', dataY)
View split_image.py
import matplotlib.pyplot as plt
import os
from PIL import Image
folder_name = 'split/'
os.makedirs(folder_name, exist_ok=True)
images = sorted([f for f in os.listdir() if f.endswith('.JPG')])
def resize(img, dirt):
View torch_mnist.py
import torch
from torchvision import transforms, datasets
from torch import nn, optim
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
View ann.py
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
import numpy as np
import os
name = "IMG_9781"
fig, ax = plt.subplots(figsize=(12, 8), dpi=100)
plt.subplots_adjust(bottom=0, top=1, left=0, right=1)
plt.title(name)
View heat_transient_matrix.py
from mpl_toolkits.mplot3d import axes3d
import numpy as np
import matplotlib.pyplot as plt
n = 15
fo = 0.5
grid = np.zeros(n)
esp = 1e-3
max_iter = None
View heat_dynamic_grid.py
import numpy as np
import matplotlib.pyplot as plt
want_size = [1000, 1000]
esp = 1e-1
label_num = 40
max_iter = None
it = 0
View heat_transient.py
from mpl_toolkits.mplot3d import axes3d
import numpy as np
import matplotlib.pyplot as plt
s = 20
r = 0.5
grid = np.zeros(s)
esp = 1e-3
label_num = 20
View heat_grid.py
import numpy as np
import matplotlib.pyplot as plt
s = [10, 10]
grid = np.zeros(s)
esp = 1e-3
def init():
grid[:, :] = 650/4