Skip to content

Instantly share code, notes, and snippets.

View mohamad-amin's full-sized avatar

Mohamad Amin Mohamadi mohamad-amin

View GitHub Profile
@mohamad-amin
mohamad-amin / wide_resnet_jax.py
Created January 3, 2022 10:11
A shallow WideResNet implemented using Flax
from functools import partial
#from typing import Callable, Optional, Sequence, Tuple
from typing import (Any, Callable, Dict, Iterable, Mapping, Optional, Sequence, Tuple,
Union)
import jax
from jax import lax
import jax.numpy as jnp
from flax import linen as nn
@mohamad-amin
mohamad-amin / madelon_pca_classification.ipynb
Created May 2, 2019 17:02
Classification on Madelon dataset, using PCA feature selection
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Compute the probability of each component in the mixture
def _computeProbabilities(self, limits):
probabilities = np.zeros(numComponents) # numComponents refers to the number of components in this mixture
for component in range(numComponents):
# gmm is a GaussianMixture from sklearn.mixture
mean = gmm.means_[component]
cov = gmm.covariances_[component]
weight = gmm.weights_[component]
probabilities[component] = constrainedGaussianDensity(mean, cov, limits) * weight
return probabilities
@mohamad-amin
mohamad-amin / Main.java
Last active March 15, 2017 13:10
A java sample about this issue in EasyMVP repository: https://github.com/6thsolution/EasyMVP/issues/28
public class Main {
public static void main(String[] args) {
for (int i=0; i<10; i++) {
SimplePresenter presenter = new SimplePresenter();
}
}
}