Tag Archives: computer programming
Hash function (散列函數):
Yes, this is still a Magic Math Mandarin blog–but to have tomorrow’s skills means a lot more than just knowing basic math.
A hash function maps arbitrary string of data fix length of bits.
The simplest (a bad one) is to use the ASCii representation of alphabet, sum up the numbers and take mod. This creates a problem as “cat”, “act” and “tca” are going to be mapped to the same hash. This problem is called “hash collision” 碰撞.
It is amazing how much one can learn from this old video, recorded 2 years after Mark Zuckerburg left Harvard. Here is what I remember after listening 5 times:
1. Don’t follow what the big guys are doing. There is so much you can do on your own with technology (find your own problem and get to it)
Q: What is git?
A: It is a digit without di 🙂 Git is currently the best (commonly used) tool for version control 目前最好的版本控制系统.
Github can be used for your own code version control by mirroring the code of a folder in your own computer. It enables version control and has workflow capabilities. Note: if you just want syncing, use Dropbox; git and Github can be a bit confusing.
What is TensorFlow? Since the best way to learn anything is to first draw upon what we already know, and then to practice. Let’s start with what it looks like to things we already know, and then what is unique about it.
Relating to the old (or something we already knew): from its design, TensorFlow has something in common with kids’ programming environment Scratch and data mining tool such as SAS Enterprise Miner: all of them use graph to represent a process, and nodes/modules to represent specific blocks of functions, without having to write a ton of code.
Although not a drag-and-drop as Scratch, SAS EM, TensorFlow does operate in similar way in that you define the graph of the process before any numerical computation is done. According to Google (GCP), “With TensorFlow, you don’t need to be knowledgeable about the advanced math models and optimization algorithms needed to implement deep neural networks. Just download the sample code and read the tutorials and you can get started in no time. The library lowers the barrier to entry for machine learning significantly.” This has been what Scratch, SAS Enterprise Miner, Alteryx and other GUI have done for their specializations.
Why it is so special
There are many other great libraries that help facilitate deep learning as well. TensorFlow is special because it is developed and maintained by Google, and it has more pros than other libraries. Google gives it away because Google believes it will have more value if more people uses it.
One of many cool things showcased at Google TF 2017 Developer Summit is a project that detects eye disease based on the same technology that identifies cats from pictures. What is special is that TF allows the project to focus more on solving the problem than figuring out all the code.
On Github TensorFlow is one of the most starred repos, where there are many exciting resources and examples getting developed each day.
- TensorFlow Examples
- 中文版TensorFlow Chinese version 中文版
- TensorFlow models
- Jupyter notebooks used in this class:
- Repository of models: https://github.com/tensorflow/models
Before watching the tutorial or reading example code, it would be better to have TensorFlow installed so that you can learn by doing instead of just watching.
I need to start the virtual enviroment, by typing “activate universe” at the command prompt. Then type “tensorboard –logdir=graphs”. Then follow the address provided by tensorboard on the command prompt, which says “http://IBM-THINK:6006”, not “http://localhost:6006”. This was successful.
When I ran a different model but with the same graph folder, then I need to delete all contents in graph before running the different model. Otherwise the graph stays in the old one while information in some other tabs of TensorBoard may change.
Everyone of us (adult Python users at least) need to install or re-install Python or the one with Anaconda. Today I had to re-install everything related to Python due to trouble getting Tensor Flow started. I primarily use Windows 10. Below steps may serve some who are going through this.