Visualoize some of the activation grids


In [1]:
import numpy as np


import matplotlib
import matplotlib.pyplot as plt

from PIL import Image

In [5]:
# def plot_single(f):
#     fig = plt.figure(frameon=False,dpi=20);
#     ax = plt.Axes(fig, [0, 0, 1, 1]);
#     ax.set_axis_off();
#     fig.add_axes(ax);
#     ax.plot(f, 'black');
#     ax.set(xlim=(0, 400));
#     ax.set(ylim=(0,1));

def plot_all(f):
    fig = plt.figure(frameon=False, figsize=(40,2), dpi=50);
    ax = plt.Axes(fig, [0, 0, 1, 1]);
    ax.set_axis_off();
    fig.add_axes(ax);
    ax.plot(f, 'black');
    ax.set(ylim=(0,1))

def plot_flux_resized(f):
    fig = plt.figure(frameon=False, figsize=(40,2), dpi=50);
    ax = plt.Axes(fig, [0, 0, 1, 1]);
    ax.set_axis_off();
    fig.add_axes(ax);
    ax.plot(f, 'black');
    
def plot_flux_normal(f):
    fig = plt.figure(frameon=False);
    ax = plt.Axes(fig, [0, 0, 1, 1]);
    ax.set_axis_off();
    fig.add_axes(ax);
    ax.plot(f, 'black');

In [7]:
# Load in data
flux0_conv1 = np.load("flux0/flux0_conv3.npy")

dim1 = int(len(flux0_conv1) / 400)
dim2 = int(400)
sep = flux0_conv1.reshape(dim1,dim2)

resized = []
for img in sep:
    new_img = img[100:300:1]
    resized.append(new_img)
    
resized = np.asarray(resized)
resized = resized.flatten()
print(resized.shape)

plot_all(resized)


(1800,)

In [8]:
flux    = np.load("../data/spectra/flux.npy")
flux0   = flux[0:400]
flux350 = flux[350:750]
flux700 = flux[700:1100]

flux1 = np.load("../data/spectra/flux1.npy")
flux1_1000 = flux1[1000:1400]

In [9]:
plot_flux_resized(flux0)



In [10]:
plot_flux_resized(flux350)



In [11]:
plot_flux_resized(flux700)



In [12]:
plot_flux_resized(flux1_1000)



In [13]:
plot_flux_normal(flux0)



In [14]:
plot_flux_normal(flux350)



In [15]:
plot_flux_normal(flux700)



In [16]:
plot_flux_normal(flux1_1000)



In [ ]: