summerschool's People
Forkers
nagyistgesummerschool's Issues
MeanSquaredError
Jeg tror der er en fejl i MeanSquaredError.
- Skal bprop ikke være:
delta_out = y-t
delta_out /= y.shape[0] # divide by num_batches
- Jeg synes fprop er lidt svær at læse p.g.a.
np.mean
. Jeg er i tvivl om det korrekte er at normalisere med num_batches eller num_bathces * num_outputs??
Jeg foreslår:
def fprop(self, x, t):
num_batches = x.shape[0]
cost = 0.5 * (x-t)**2 # samples, num_outputs
cost = cost.sum(axis=-1) # sum out outputs
return cost / num_batches
Orginal
class MeanSquaredLoss():
def __str__(self):
return "MeanSquaredLoss()"
def fprop(self, x, t):
num_batches = x.shape[0]
cost = 0.5 * (x-t)**2 / num_batches
return np.mean(np.sum(cost, axis=-1))
def bprop(self, y, t):
delta_out = y-t
return delta_out
def update_params(self):
pass
TanhActivationLayer
Tanh har ikke den rigtige gradient. Eller den er i hverttilfælde ustabil
Her er en bedre implementering:
class TanhActivationLayer():
def __str__(self):
return "Tanh()"
def fprop(self, x, train=True):
self.a = np.tanh(x)
return self.a
def bprop(self, delta_in):
return (1-self.a**2)*delta_in
def update_params(self, lr):
pass
SoftPlus
I softplus får jeg:
Jeg ved ikke om det kan simplificeres yderligere?
Jeg foreslår vi implementerer det som:
class SoftplusActivationLayer():
def __str__(self):
return "Softplus()"
def fprop(self, x, train=True):
self.g = np.exp(x) + 1
self.a = np.log(g)
return self.a
def bprop(self, delta_in):
return delta_in * 1-g**(-1)
def update_params(self, lr):
pass
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.