Given the Cross Entroy Cost Formula:
where:
J
is the averaged cross entropy costm
is the number of samples- super script
[L]
corresponds to output layer
Q: how the following two differ, in the computation of prediction accuracy? (note: Y
= true label, Y_preduction
= predicted label).
(from deeplearning.ai, programming assignment. Course 1 - deep learning and neural network.)
Option 1 - Logistric Regression (Week 2):
print("Test accuracy: {} %".format(100 - np.mean(np.abs(Y_prediction - Y)) * 100))
Imagine we have n
particles in our "universe". These particles have a random initial x, y, and z coordinates to begin with. Defined by Newton's law of universal gravitation, each particle attracts every other particles in this universe using a force that is directly proportional to the product of their masses and inversely proportional to the square of the distance between their centers. As as result, these particles gain (and lose) velocities and change positions over time. The modelling of this physical mechanics is called a N-body simulation.
There currently exists many N-body simulation algorithms. Some are less advanced and highly computational costly (execution time in the order of O(N^2)
) - but simple and easy to understand. Some others are more advanced and significantly more efficient (execution in the order of O(n*log(n))
- but not as simple and easy to understand. This articles focuses on the implementation aspect of the less advanced toy algorithm - for the benefit of ease o
name: helloworld | |
dependencies: | |
- python=2.7 | |
- anaconda |
Started learning about voice assistant development with Alexa recently. Using this page to jot down some notes for ease of future references.
Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.
First install motion
:
~> sudo apt-get install motion
Then create a config file:
~> mkdir ~/.motion
~> nano ~/.motion/motion.conf
Use this page to jot down notes regarding small garden birdwatch project.
import numpy as np | |
# sow a fix seed to make trial and error more predictable | |
np.random.seed(0) | |
# create a 10 x 3 NumPy array | |
a = np.random.rand(10,3) | |
# do the fancy indexing: for each row, extract the element that is closest to 0.5 | |
a2 = a[np.arange(a.shape[0]), np.argsort(np.abs(a - 0.5))[:,0]] |
<html> | |
<head> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> | |
<script src="//ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script> | |
<!-- | |
TODO: |