Skip to content

Instantly share code, notes, and snippets.

View sheridp's full-sized avatar

Patrick Sheridan sheridp

View GitHub Profile
@sheridp
sheridp / test.py
Created July 12, 2017 17:44
Simpy Conditional Get
env = Environment()
class ConditionalGet(simpy.resources.base.Get):
def __init__(self, resource, condition=lambda: True):
self.condition = condition
super().__init__(resource)
class aStore(simpy.resources.store.Store):
get = simpy.core.BoundClass(ConditionalGet)
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_mldata
from sklearn.decomposition import FastICA, PCA
from sklearn.cluster import KMeans
# fetch natural image patches
image_patches = fetch_mldata("natural scenes data")
X = image_patches.data