vault backup: 2023-06-12 19:07:33
Affected files: .obsidian/backlink.json .obsidian/graph.json .obsidian/workspace-mobile.json .obsidian/workspace.json Events/🪣🪣🪣.md Health/ADHD.md STEM/AI/Classification/Gradient Boosting Machine.md STEM/AI/Neural Networks/CV/Visual Search/Visual Search.md STEM/AI/Neural Networks/Learning/Tasks.md STEM/AI/Pattern Matching/Dynamic Time Warping.md STEM/AI/Problem Solving.md STEM/CS/Regex.md STEM/img/dtw-graph-unit.png STEM/img/dtw-graph.png STEM/img/dtw-gross-partitioning.png STEM/img/dtw-heatmap-distortion.png STEM/img/dtw-heatmap.png STEM/img/dtw-possible-movements.png STEM/img/dtw-score-pruning.png STEM/img/nn-tasks-function-approx-inverse.png STEM/img/nn-tasks-function-approx.png STEM/img/nn-tasks-pattern.png STEM/img/problem-solving-arch.png STEM/img/problem-solving-goal-based.png STEM/img/problem-solving-reflex.png STEM/img/visual-search-arch.png STEM/img/visual-search-crude.png
@ -4,4 +4,5 @@
|
||||
- Strictly outperform random forest most of the time
|
||||
- Similar properties
|
||||
- One of the best algorithm for dealing with non perceptual data
|
||||
- XGBoost
|
||||
- XGBoost
|
||||
- [Confusing XGBoost Hyperparameters](https://towardsdatascience.com/10-confusing-xgboost-hyperparameters-and-how-to-tune-them-like-a-pro-in-2023-e305057f546?source=rss----7f60cf5620c9---4)
|
10
AI/Neural Networks/CV/Visual Search/Visual Search.md
Normal file
@ -0,0 +1,10 @@
|
||||
- Shallow would be BOVW
|
||||
- Use metric space over feature space
|
||||
- Get ranked list
|
||||
|
||||
![](../../../../img/visual-search-arch.png)
|
||||
# Crude Method
|
||||
- Doesn't enforce metric relationship
|
||||
- Sample prior to final softmax
|
||||
![](../../../../img/visual-search-crude.png)
|
||||
|
44
AI/Neural Networks/Learning/Tasks.md
Normal file
@ -0,0 +1,44 @@
|
||||
# Pattern Association
|
||||
- Associative memory
|
||||
- Learns by association
|
||||
- Autoassociation
|
||||
- Store a set of patterns by repeatedly presenting them in the network
|
||||
- Then presented partial or distorted stored pattern
|
||||
- Recall intended
|
||||
- Input and output data spaces are same dimensionality
|
||||
- Heteroassociation
|
||||
- Arbitrary set of input patterns paired with another arbitrary set of output patterns
|
||||
- Supervised instead of unsupervised
|
||||
- No required relationship between input/output dimensionality
|
||||
- Stages
|
||||
- Storage
|
||||
- Recall
|
||||
|
||||
# Pattern Recognition
|
||||
- Received pattern/signal is assigned to one of a prescribed number of classes
|
||||
![](../../../img/nn-tasks-pattern.png)
|
||||
|
||||
# Function Approximation
|
||||
- System Identification
|
||||
![](../../../img/nn-tasks-function-approx.png)
|
||||
- Inverse System
|
||||
![](../../../img/nn-tasks-function-approx-inverse.png)
|
||||
|
||||
# Control
|
||||
- Learn to control a process or critical part of a system
|
||||
|
||||
# Filtering
|
||||
- Filtering
|
||||
- Extraction of information about a quantity of interest at discrete time $n$ by using data from time up to $n$
|
||||
- Smoothing
|
||||
- Use information past time $n$
|
||||
- Expect smoother result
|
||||
- Delay in processing
|
||||
- Prediction
|
||||
- Predict later data using current and previous
|
||||
|
||||
# Beamforming
|
||||
- Spatial filtering
|
||||
- Distinguish spatial properties of a target signal and background noise
|
||||
- Similar to bats
|
||||
- Used in radar and sonar
|
@ -0,0 +1,73 @@
|
||||
***Deterministic
|
||||
Pattern Recogniser***
|
||||
Allows timescale variations in sequences for same class
|
||||
|
||||
![](../../img/dtw-graph.png)
|
||||
|
||||
$$D(T,N)=\min_{t,i}\sum_{\substack{t\in1..T \\ i\in1..N}}d(t,i)$$
|
||||
- $d(t,i)$ is distance between features from $t$-th frame of test to $i$-th frame of template
|
||||
|
||||
$$D(t,i)=\min[D(t,i-1),D(t-1, i-1),D(t-1,i)]+d(t,i)$$
|
||||
- Allowing transition from current and previous frame only
|
||||
- Recursive
|
||||
|
||||
![](../../img/dtw-graph-unit.png)
|
||||
|
||||
# Problems
|
||||
- How much flexibility to allow?
|
||||
- How to penalise warping?
|
||||
- How to determine a fair distance metric?
|
||||
- How many templates to register?
|
||||
- How to select best ones?
|
||||
|
||||
# Basic Algorithm
|
||||
1. Initialise the cumulative distances for $t=1$
|
||||
$$D(1,i)=\begin{cases}d(1,i) & \text{for }i=1, \\ D(1, i-1)+d(1,i) & \text{for }i=2,...,N\end{cases}$$
|
||||
2. Recur for $t=2,...,T$
|
||||
$$D(t,i)=\begin{cases}D(t-1,i) + d(t,i) & \text{for }i=1, \\ \min[D(t, i-1), D(t-1, i-1),D(t-1,i)] + d(t,i) & \text{for }i=2,...,N\end{cases}$$
|
||||
3. Finalise, the cumulative distance up to the final point gives the total cost of the match: $D(T,N)$
|
||||
|
||||
![](../../img/dtw-heatmap.png)
|
||||
- Euclidean distances
|
||||
|
||||
# Distortion Penalty
|
||||
1. Initialise the cumulative distances for $t=1$
|
||||
$$D(1,i)=\begin{cases}d(1,i) & \text{for }i=1, \\ d(1,i)+D(1, i-1)+d_V & \text{for }i=2,...,N\end{cases}$$
|
||||
2. Recur for $t=2,...,T$
|
||||
$$D(t,i)=\begin{cases}d(t,i)+D(t-1,i1)+d_H & \text{for }i=1, \\ \min[d(t,i)+D(t,i-1)+d_V,2d(t,i)+D(t-1,i-1),d(t,i)+D(t-1,i)+d_H] & \text{for }i=2,...,N\end{cases}$$
|
||||
- Where $d_V$ and $d_H$ are costs associated with vertical and horizontal transitions respectively
|
||||
3. Finalise, the cumulative distance up to the final point gives the total cost of the match: $D(T,N)$
|
||||
|
||||
- Allows weighting for dynamic penalties when moving horizontally or vertically
|
||||
- As opposed to diagonally
|
||||
|
||||
![](../../img/dtw-heatmap-distortion.png)
|
||||
|
||||
# Store Best Path
|
||||
1. Initialise distances and traceback indicator for $t=1$
|
||||
$$D(1,i)=\begin{cases}d(1,i) & \text{for } i=1,\\ d(1,i)+D(1,i-1) & \text{for }i = 2,...,N\end{cases}$$
|
||||
$$\phi(1,i)=\begin{cases}[0,0] & \text{for } i=1,\\ [1,i-1] & \text{for }i = 2,...,N\end{cases}$$
|
||||
2. Recur for cumulative distances at $t=2,...,T$
|
||||
$$D(1,i)=\begin{cases}d(t,i)+D(t-1,i) & \text{for } i=1,\\ d(t,i)+\min[D(t,i-1),D(t-1,i-1),D(t-1,i)] & \text{for }i = 2,...,N\end{cases}$$
|
||||
$$\phi(1,i)=\begin{cases}[t-1,i] & \text{for } i=1,\\ \arg\min[D(t,i-1),D(t-1,i-1),D(t-1,i)] & \text{for }i = 2,...,N\end{cases}$$
|
||||
3. Final point gives the total alignment cost D(T,N) and the end coordinates of the best path $z_K=[T,N]$, where $K$ is the number of nodes on the optimal path
|
||||
4. Trace the path back for $k=K-1,...,1,z_k=\phi(z_{k+1}), \text{ and }Z=\{z_1,...,z_K\}$
|
||||
- Stores best path
|
||||
|
||||
![](../../img/dtw-possible-movements.png)
|
||||
- Vary allowable movements through grid
|
||||
- Second row for blocking multiple of the same movements in succession
|
||||
|
||||
# Search Pruning
|
||||
- Speed up algorithm for real-time
|
||||
- Kill bad options
|
||||
|
||||
## Gross Partitioning
|
||||
![](../../img/dtw-gross-partitioning.png)
|
||||
- Too far from diagonal
|
||||
- Probably wrong or bad
|
||||
|
||||
## Score Pruning
|
||||
![](../../img/dtw-score-pruning.png)
|
||||
- Examine existing branches
|
||||
- See which scores are really bad
|
57
AI/Problem Solving.md
Normal file
@ -0,0 +1,57 @@
|
||||
# Problem Types
|
||||
- Toy/game problems
|
||||
- Illustrative
|
||||
- Real world problems
|
||||
- Exact solutions
|
||||
|
||||
# Intelligent Agents
|
||||
*Any thing which can be viewed as perceiving its environment through sensors and acting upon that environment through its affectors*
|
||||
|
||||
## Reflex
|
||||
![](img/problem-solving-reflex.png)
|
||||
## Goal Based
|
||||
![](img/problem-solving-goal-based.png)
|
||||
## Utility-based
|
||||
|
||||
# Environments
|
||||
- (in)accessible
|
||||
- (non)-deterministic
|
||||
- (non)-episodic
|
||||
- Static/dynamic
|
||||
- Discrete/continuous
|
||||
|
||||
# Solving
|
||||
1. Precise problem definition
|
||||
- Start conditions and goal state
|
||||
2. Problem analysis
|
||||
- Appropriate representation
|
||||
- Problem characteristics
|
||||
- Knowledge intensive
|
||||
- Decomposability
|
||||
3. Choice of best technique
|
||||
|
||||
# Moves
|
||||
- Ignorable
|
||||
- Simple control structure
|
||||
- Recoverable
|
||||
- Backtrack using control stack
|
||||
- Irrecoverable
|
||||
- Much effort needed for each decision/move
|
||||
|
||||
![](img/problem-solving-arch.png)
|
||||
- Control
|
||||
- Cause movement
|
||||
- Be systematic
|
||||
- Be guided by heuristics
|
||||
|
||||
# Predictability
|
||||
## 8 Puzzle
|
||||
- Can plan ahead with certainty — only need a
|
||||
control structure with backtracking
|
||||
- recoverable, certain outcome
|
||||
## Chess
|
||||
- Future moves are not predictable with certainty.
|
||||
- May need to consider several possibilities, and decide best option based on Incomplete information
|
||||
- irrecoverable — once a piece is taken cannot in general recover from this state.
|
||||
- deciding on an optimal move can be difficult
|
||||
- try to predict opponent's move
|
14
CS/Regex.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Markdown
|
||||
|
||||
## All links
|
||||
`\[.*?\]\(.*?\)`
|
||||
|
||||
## Images
|
||||
`!\[.*?\]\(.*?\.png\)`
|
||||
|
||||
## Inter-Ref
|
||||
`\[.*?\]\(.*?\.md(#.*?)*\)`
|
||||
|
||||
## Tags
|
||||
`#{1}[^\s#.]+`
|
||||
`(^|[[:blank:]])#{1}[^\s#.]+`
|
BIN
img/dtw-graph-unit.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
img/dtw-graph.png
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
img/dtw-gross-partitioning.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
img/dtw-heatmap-distortion.png
Normal file
After Width: | Height: | Size: 512 KiB |
BIN
img/dtw-heatmap.png
Normal file
After Width: | Height: | Size: 455 KiB |
BIN
img/dtw-possible-movements.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
img/dtw-score-pruning.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
img/nn-tasks-function-approx-inverse.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
img/nn-tasks-function-approx.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
img/nn-tasks-pattern.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
img/problem-solving-arch.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
img/problem-solving-goal-based.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
img/problem-solving-reflex.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
img/visual-search-arch.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
img/visual-search-crude.png
Normal file
After Width: | Height: | Size: 69 KiB |