Domain Of Interest
Number Theory
Linear Algebra
Applied Physics
Discrete Mathematics
Calculus
Probability and Statistics
Machine Learning
Signals and systems
Data Compression
Control Systems
Computer Architecture
Operating Systems
Advance Data Structure
OOPS
Design and Analysis Of Algorithm
Digital /Analog Electronics
Microprocessors and Microcontrollers
Projects and other roles:
Ekasutram (Mathematics Club) (Pune, Maharashtra) 08 2018 - Present
Title – Club Head
The club conducts activities like mathematics seminar on number theory.
Application of mathematics in coding through coding competition.
The setting of problems for a coding competition and the mathematical question of the week.
Organizing a session like Machine Learning without using libraries and activities related to game theory.
HackerEarth (Pune, Maharashtra) 07 2019 – 09 2019 (Django, Machine Learning)
Title – Missing Hackathon
An application that utilizes available digital footprint in an ML model.
Goal is to suggest the location of a missing person.
An architecture is created for different designation of police officials.
Everyone with their own portal to perform activities like assigning cases, uploading documents etc.
Kneo Automation Pvt Ltd (Pune, Maharashtra) 05 2019 - 07 2019 (Django, ML in python)
Title – Project Intern
The project involved the building of Machine Learning models.
Input parameters included bd_tracedate, bd_rise, bd_fall, bd_event_code.
The goal of this project was to predict the errors (event code) occurring in machines.
Hacknight1.0 sponsored by Microsoft (Bengaluru, Karnataka) 07 2019 - 08 2019
Title – Hackathon
Built a UI on top of a Machine Learning model which predicts whether an employee should be given leave or not.
There were 27 Input parameters like timestamp, age, gender, country, self-employed, family
history, work interfere, number of employees, benefits, welfare program, comments etc.
competitive round score - 97.370000
ML round score – 81.853282
Title – Hospital Management System (Django, azure)
An application that manages hospital such as booking an appointment, updating doctor's available hours, patient diagnosis and prescription.
Title – Handwritten digit recognition
Numbers are recognized using Neural Network using octave.
Title – MyOS (C, assembly)
An OS that can be installed on any 32-bit machine.
Dear Developers,
I am Shubham pursuing my graduation in CSE with specialization in Machine Learning . I am comfortable with python , c , c++ and very active in creating projects . Mathematics is core part for a programmer and so for me . I have been going through Sympy documentation for a month . So , i have little familiarity with sympy and feel I can really contribute to it.
i am comfortable with :
Linear Algebra
Probability and Statistics
Transform Calculus
Differential equation
Numerical solution of ordinary and partial differential equations
So, can you suggest me some project ?
Regards
Shubham
I am referring the given links for optimizing floating-point expressions
https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/02Numerics/Double/paper.pdf
To Do
1] databases of rules to find rearrangements(the database can be updated by user)
Including those for the commutativity, associativity, distributivity
Identity of basic arithmetic operators
Fraction arithmetic
Laws of squares, square roots, exponents, logarithms
Some basic facts of trigonometry
2] sampling points
These input points are sampled uniformly from the set of floating point bit patterns.
Each sampled point is a combination of a random mantissa, exponent, and a sign bit.
By sampling exponents uniformly, We can generate both very small and very large input points, as well as inputs of normal size
3] error calculation
STOKE: error = no_of_floating_point_values_between(approximate and exact_answer)
E(x, y) = log 2 |{z ∈ FP | min(x, y) ≤ z ≤ max(x, y)}|
mpmath can be used for this operation.
4] localizing the error points and operators
We use a greedy, hill-climbing search to tracks a set of candidate programs
apply rules at various locations in these candidates, evaluates each resulting program, and repeats the process on the best candidates.
For polynomial approximations, we can use sympy specialized series expansion pass to handle inaccuracies near 0 and ±∞
7] recursively solving the subparts
Simplifying the equation
Replacing the expression using the different equations from the database.
Series expansion
recursively solving the candidate keys.
5] finding operations with the highest error
using srepr tree for getting subexpressions.
For each operation, we will average the local error for all sample points,
focuse its rewrites at the operations with the highest average
simplifying rewrites after every step.
6] Updating program Table
keeping only those candidates that achieve the best accuracy on at least one sample point.
store the processed program
after adding the candidate it might happen that previously added are no longer best so they can also be removed from the table.
above mentioned paper suggests that in practice, running until the table reaches saturation does not give better results than running for 3 iterations.
7] returning the split Piecewise expression for different ranges
based on the sample points
Functions (refering the above mentioned lines), I want to implement the following functions for my GSOC project
Definition-main(program) :
points := sample-inputs(program)
exacts := evaluate-exact(program, points)
table := make-candidate-table(simplify(program))
repeat N times
candidate:= pick-candidate(table)
locations := sort-by-local-error(all-locations(candidate))
locations.take(M )
rewritten := recursive-rewrite(candidate, locations)
new-candidates := simplify-each(rewritten)
table.add(new-candidates)
approximated := series-expansion(candidate, locations)
table.add(approximated)
return infer-regimes(table).as-program
Definition local-error(expr, points) :
for point ∈ points :
args := evaluate-exact(expr.children)
exact-ans := F(expr.operation.apply-exact(args))
approx-ans := expr.operation.apply-approx(F(args))
accumulate E(exact-ans, approx-ans)
Definition recursive-rewrite(expr, target) :
select and where are non-deterministic choice and requirement
select input
output from RULES
where input.head = expr.operator ∧ output.head = target.head
for (subexpr, subpattern) ∈ zip(expr.children, input.children) :
if ¬matches(subexpr, subpattern) :
recursive-rewrite(subexpr, subpattern)
where matches(expr, input)
expr.rewrite(input -> output)
Definition simplify(expr) :
iters := iters-needed(expr)
egraph := make-egraph(expr)
repeat iters times :
for node ∈ egraph :
for rule ∈ SIMPLIFY - RULES :
attempt-apply(rule, node)
return extract-smallest-tree(egraph)
Definition iters-needed(expr) :
if is-leaf(expr) :
return 0
else :
sub-iters := map(iters-needed, expr.children)
iters-at-node := if is-commutative(expr.head) then 2 else 1
return max(sub-iters) + iters-at-node
Definition infer-regimes(candidates, points) :
for x i ∈ points :
best-split 0 [x i ] = [regime(best-candidate(−∞, x i ), −∞, x i )]
for n ∈ N until best-split n+1 = best-split n :
for x i ∈ points ∪ {∞} :
for x j ∈ points, x j < x i :
extra-regime := regime(best-candidate(x j , x i ), x i , x j )
option[x j ] := best-split[x j ] ++ [extra-regime]
best-split n+1 [x i ] := lowest-error(option)
if best-split n [x i ].error − 1 ≤ best-split n+1 [x i ].error :
best-split n+1 [x i ] := best-split n [x i ]
split := best-split ∗ [∞]
split.refine-by-binary-search()
return split
Please share your insights on this topic.
from sympy import *import numpy as np
x = Symbol("x")y = Symbol("y")z = Symbol("z")
#pointsmaxi = 1000000000000000000000000000000mini = -1000000000000000000000000000000step = (maxi-mini)/256
start = minipoints = []
for i in range(0,256): points.append(start) start += step
#calculate errordef calc_error(expr,point): from mpmath import mp, mpf mp.dps = 1000 symb = expr.atoms(Symbol) unq_sym = len(symb)
subst_sym = [] subst_mpf = []
i=0 for sym in symb: subst_sym.append((x,point)) #subst_sym.append((x,300)) #subst_sym.append((z,400)) subst_mpf.append( ( sym,mpf(point) ) ) i = i+1
ans1 = expr.subs(subst_sym) ans2 = expr.subs(subst_mpf) return ans1,ans2
#replacement functions#database rule = []rule.append(lambda exp: (exp.args[0]**3 + exp.args[1]**3)/(exp.args[0]**2 + exp.args[1]**2 - exp.args[1]*exp.args[0]) if type(exp) ==Add and len(exp.args)==2 and (type(exp.args[0]) != Symbol and type(exp.args[1]) != Symbol) else False)rule.append(lambda exp: (exp.args[0]**2 - exp.args[1]**2)/(exp.args[0]-exp.args[1]) if type(exp) ==Add and len(exp.args)==2 and (type(exp.args[0]) != Symbol and type(exp.args[1]) != Symbol)else False)#rule.append(lambda expr: exp(log(expr)))
#rule1 = lambdify([x, y, (x**2 - y**2)/(x+y))
expr = (x+1)**0.5 - x**0.5#expr = x+1-x #+ (1/(x-1)) - (2/x)#expr = (-y + (-4*x*z + y**2)**0.5)/(2*x)#expr = (x+1)**(1/3) - x**(1/3)#expr = (x+1)**0.25 - x**0.25 expr = simplify(expr)main_expr = exprtemp_expr = exprpprint(rule[0](expr))print(rule[1](expr))
all_func = []mapper = dict()
def pre(expr): for fi in rule: print("see ",expr) for pnt in points: for fi in rule: k = fi(expr) if k!=False: ans1, ans2 = calc_error(expr, pnt) update_func = main_expr.subs(expr, k) ans3, ans4 = calc_error(update_func, pnt) diff1 = ans2 - ans1 diff2 = ans4 - ans3 #print("istrue ", ans4==ans2) #print("check1 ", ans4) #print("check2 ", ans2) #print("difference ", diff1, " ", diff2) try: if abs(diff2) <= abs(diff1): #(diff2) <= (diff1) all_func.append(update_func) print("inn ", pnt) try: lister = mapper[update_func] lister.append(pnt) mapper[update_func] = lister except: mapper[update_func] = [pnt] except: print("failed ",pnt) #print(abs(diff1), " ", abs(diff2)) #gprint(isinstance(diff2, complex)) #print(update_func) #exit() #all_func.append(simplify(main_expr.subs(expr,k))) print(expr, " space ",) for arg in expr.args: pre(arg)
if len(all_func)==0: all_func.append(simplify(main_expr))
pre(expr)#print(srepr(expr))#pprint(set(all_func))#print("mapper")#print(mapper)values = list(set(all_func))i=0for expr in values: values[i] = expr.replace( lambda expr: type(expr)== Pow and expr.args[1]==1, lambda expr: Mul(expr.args[0],1)) i = i+1pprint(values)Enter code here...