Skip to content

Instantly share code, notes, and snippets.

Avatar

ali risheh aicam

  • sepantab
View GitHub Profile
@aicam
aicam / min-char-rnn.py
Created Mar 26, 2021 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
View min-char-rnn.py
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
View diversity_MSE.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aicam
aicam / convolutions.py
Created Jul 2, 2020 — forked from jdumont0201/convolutions.py
Image processing with convolutions in Python
View convolutions.py
import cv2
import numpy as np
img = cv2.imread('images/input.jpg')
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
rows,cols = img.shape[:2]
cv2.imshow('Original',img)
@aicam
aicam / autoencoder.py
Created Jun 15, 2020
this method returns two models : first is a complete autoencoder model with training option and an encoder to use to encode your data
View autoencoder.py
from sklearn.metrics import confusion_matrix,classification_report
import keras.backend as K
from keras.engine.topology import Layer, InputSpec
from keras.layers import Dense, Input
from keras.models import Model
from keras.optimizers import SGD
from keras import callbacks
from keras.initializers import VarianceScaling
from sklearn.cluster import KMeans
@aicam
aicam / golang-jwt-example.go
Created Jun 5, 2020
This file contains two function to create and sign JWT token, the generation needs a token which is declared global in file but token key passes to check function
View golang-jwt-example.go
package cryptoUtils
import (
"github.com/dgrijalva/jwt-go"
"time"
)
type Credentials struct {
Password string `json:"password"`
Username string `json:"username"`
@aicam
aicam / rsa_util.go
Created May 11, 2020 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
View rsa_util.go
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@aicam
aicam / HttpProxy.go
Created Mar 16, 2020 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
View HttpProxy.go
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)