View Mn_whitelineratio
%matplotlib widget | |
import hyperspy.api as hs | |
import matplotlib.pyplot as plt | |
import numpy as np | |
ll_sum = hs.load('ll_sum.hspy') | |
s_sum = hs.load('s_sum.hspy') | |
s_sum.metadata.Acquisition_instrument.TEM.beam_energy=200 | |
s_sum.metadata.Acquisition_instrument.TEM.convergence_angle=22.5 | |
s_sum.metadata.Acquisition_instrument.TEM.Detector.EELS.collection_angle=37.9 |
View augumented_hdf5_matrix.py
"""Another way, note this one will load the whole array into memory .""" | |
from keras.preprocessing.image import ImageDataGenerator | |
import h5py | |
from keras.utils.io_utils import HDF5Matrix | |
seed=0 | |
batch_size=32 | |
# we create two instances with the same arguments | |
data_gen_args = dict( | |
rotation_range=90., |
View coordconv2d.py
import keras.backend as K | |
import tensorflow as tf | |
from keras.layers import Layer | |
from keras.layers import Conv2D | |
"""Not tested, I'll play around with GANs soon with it.""" | |
class CoordConv2D(Layer): | |
def __init__(self, channel, kernel, padding='valid', activation=None, **kwargs): |
View selectfile.py
import os | |
import ipywidgets as widgets | |
class FileBrowser(object): | |
def __init__(self): | |
self.path = os.getcwd() | |
self._update_files() | |