Deep L-layer neural network

Layer counting:

  • input layer is not counted as a layer, "layer 0"
  • last layer (layer L, output layer) is counted.

notation: layer 0 = input layer L = number of layers n^[l] = size of layer l a^[l] = activation of layer l = g[l]( z[l] ) → a ...

Neural Networks Overview

new notation:

  • superscript [i] for quantities in layer i. (compared to superscript (i) for ith training example).
  • subscript i for ith unit in a layer

Neural Network Representation

notation:

  • a^[i]: activation at layer i.
  • input layer: x, layer 0.
  • hidden layer
  • output layer: prediction (yhat)
  • don ...

This week: logistic regression.

Binary Classification & notation

ex. cat classifier from image image pixels: 64x64x3 ⇒ unroll(flatten) to a feature vector x dim=64x64x3=12288:=n (input dimension)

notation

  • superscript (i) for ith example, e.g. x^(i)
  • superscript [l] for lth layer, e.g. w^[l]
  • m: number of ...

What is a neural network?

Example: housing price prediciton.

Each neuron: ReLU function

Stacking multiple layers of neurons: hidden layers are concepts more general than input layer — found automatically by NN.

Supervised Learning with Neural Networks

supervised learning: during training, always have output corresponding to input.

Different NN types are ...

Save settings and configurations.

Data Persistance

5 different ways of data persistance:

  • onSavedInstanceState(): store state of views in k-v pairs (Bundles), used when screen rotates / app killed by system, temperary.
  • SharedPreferences: save k-v pairs to a file, can save primitive types.
  • SQLite database: complicated data types
  • Internal / External Storage: save ...

Android kills background apps !!

onCreate()CreatedonStart()Visible(can be seen on screen) → onResume()Active(get focus, can interact with)

ActiveonPause()Paused(lose focus — same thing as Visible?) → onStop()Stopped(disappeared) → onDestroy()Destroyed(lifecycle ends)

when rotate screen, the function calling is:

onPause --> onStop --> onDestroy --> onCreate --> onStart --> onResume

note ...

Recycler View, Adaper, ViewHolder

rather than creating list items as we scroll, keep them in a queue (recycling bin) → when scrolling, the list items are recycled and re-bind to new content. RecyclerView is better version of ListView.

Adaper: bind data from data source, and provide the RecyclerView with new views ...

So far: single screen with a single activity.

start activity from another activity: use Intents.

Explicit intent: start a new activity

toy app: type some text, press button, and a new activity will appear with the typed words.

create activity in android studio: new → activity

call startActivity with an ...

1 create project sunshine

Created 星期一 06 二月 2017

minSDK vs targetSDK

The minSDK is the lowest SDK level that your app can run on. You can choose what level of devices to support.

By comparison, the targetSDK is NOT a high pass filter -- it’s used only to declare ...