Skip to content

Instantly share code, notes, and snippets.

@yindia
yindia / kmeans.py
Created May 18, 2017 07:52
stackoverflow question
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
points_n = 200
clusters_n = 3
iteration_n = 100
x = tf.cast(tf.convert_to_tensor(np.random.rand(points_n,2),dtype=tf.float32),tf.float32)
points = tf.placeholder(tf.float32, [points_n,2])
@yindia
yindia / input_data.csv
Created May 24, 2017 15:08
Need Help to feed data To Tensor
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
Action,Drama,Thriller,Comedy,Romance,Adventure,Animation,History,Sci-Fi,Family,Crime,Horror,Mystery,Fantasy,Documentary,"Sports ",War,Suspense,Musical,Biography,Social,Mythology,Classic,Devotional,Satire,Dance,Children,Noir,"Period ",CRIME,Magic,"Short Film",ROMANCE,DEVOTIONAL,Patriotic,"International Music ",Festival,Theatre,Cricket,Concert,Screening,ACTION,,"Party ",Bollywood,Romantic,Adult,Classical,Religious,Psychological,Spiritual,Music,Political,Zombie-Comedy,Romantic-Comedy,Action-Comedy,EDM,"Fusion Music","Rock ",Pop,Western,Kids,Screenings,"Black / Dark Comedy",Fiction,Entertainment,Period,Emotional,Offbeat,Adaptation,Friendship,Love,Mature,Supernatural,Sports,Costume,HISTORY,Art,General,"Special Interest",FAMILY,COMEDY,DRAMA,Obscure,Teenage,"Black Comedy",SOCIAL,Classics,Short,MYSTERY,Urban,THRILLER,"ROMANCE COMEDY","Love Triangle","Science fiction",Biopic,Spirituality,"Performing Arts",Westren,Filmnoir,"Costume Drama",Stunt,Historical,"Science Fiction","Crime Thriller",Thiller,"ACTION COMEDY","Roma
@yindia
yindia / tensorflow001.py
Last active September 27, 2017 21:01
Tensor flow basic
import tensorflow as tf #importing the tensorflow library
#Input node for computational graph as input
data = [
[1, 0, 0],
[1, 0, 1],
[1, 1, 1],
[0, 1, 1],
]
#Input node for computational graph as output

Keybase proof

I hereby claim:

  • I am evalsocket on github.
  • I am evalsocket (https://keybase.io/evalsocket) on keybase.
  • I have a public key whose fingerprint is 55C8 1214 57C5 6EA5 919D 92E8 AF8A BF83 0AED B0B7

To claim this, I am signing this object:

@yindia
yindia / envoy.yml
Last active January 6, 2019 11:43
GRPC Front Proxy
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 80
use_original_dst: true
filter_chains:
- filters:
- name: envoy.http_connection_manager
---
listeners:
- address: tcp://0.0.0.0:9999
use_original_dst: true
filters:
- type: read
name: http_connection_manager
config:
codec_type: auto
stat_prefix: ingress_http
# Stage 1 - the build process
FROM node:10.11.0-alpine AS base
MAINTAINER evalsocket@protonmail.com
WORKDIR /usr/src/app
# dev image contains everything needed for testing, development and building
FROM base AS development
COPY package.json yarn.lock ./
# first set aside prod dependencies so we can copy in to the prod image
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: tiller-clusterrolebinding
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
roleRef:
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: prom-admin
rules:
# Just an example, feel free to change it
- apiGroups: [""]
resources: ["clusterRole", "clusterRoleBinding"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: prom-rbac
subjects:
- kind: User
name: yuvraj@zoop.one
roleRef:
kind: ClusterRole
name: prom-admin