Skip to content

Instantly share code, notes, and snippets.

View aidevnn's full-sized avatar
🆓
Free

Maths Coder aidevnn

🆓
Free
View GitHub Profile
@james-d-mitchell
james-d-mitchell / todd_coxeter.py
Last active January 27, 2024 03:21
An implementation of the Todd-Coxeter Algorithm for Semigroups and Monoids in python3
#!/usr/bin/env python3
class ToddCoxeter:
def __init__(self):
self.nodes = [0]
self.edges = None
self.kappa = []
self.next_node = 1
self.R = []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@monikkinom
monikkinom / rnn-lstm.py
Last active September 3, 2019 04:44
Tensorflow RNN-LSTM implementation to count number of set bits in a binary string
#Source code with the blog post at http://monik.in/a-noobs-guide-to-implementing-rnn-lstm-using-tensorflow/
import numpy as np
import random
from random import shuffle
import tensorflow as tf
# from tensorflow.models.rnn import rnn_cell
# from tensorflow.models.rnn import rnn
NUM_EXAMPLES = 10000
@stewartpark
stewartpark / xor.py
Created October 12, 2015 08:17
Simple XOR learning with keras
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
import numpy as np
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])
model = Sequential()
model.add(Dense(8, input_dim=2))
@trevordixon
trevordixon / pq.cs
Created April 10, 2014 16:51
C# Priority Queue
using System;
using System.Collections.Generic;
// From http://visualstudiomagazine.com/articles/2012/11/01/priority-queues-with-c.aspx
public class PriorityQueue<T> where T : IComparable<T> {
private List<T> data;
public PriorityQueue() {
this.data = new List<T>();
}