This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deepEqual ( a, b ) { | |
let equalCount = Object.keys( a ).length === Object.keys( b ).length; | |
if ( equalCount ){ | |
for ( let key in a ){ | |
if ( typeof a[key] === typeof b[key] ){ | |
if ( typeof a[key] !== "object" ){ | |
if ( a[key] !== b[key] ){ | |
return false; | |
} | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source ~/.bash_folder/colors | |
alias gg="git gui" | |
alias gka="gitk --all &" | |
alias gk="gitk &" | |
alias gcm="git checkout master" | |
alias gp="git pull --rebase" | |
alias grm="git rebase master" | |
alias grom="git fetch origin;git rebase origin/master" | |
alias gb="git branch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
c = commit | |
s = status | |
b = branch | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
type = cat-file -t | |
dump = cat-file -p | |
d = diff | |
a = add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Double all the even numbers in the given array **/ | |
const isEven = (n) => n % 2 === 0; | |
const doubleIt = (n) => n * 2; | |
const finalAnswer = [1, 2, 3, 4] | |
.filter(isEven) | |
.map(doubleIt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ID | IP Address: String | Browser: String | Duration: Number | |
---|---|---|---|---|
0 | 86.98.19.228 | Chrome | 40 | |
1 | 95.255.60.157 | Firefox | 50 | |
2 | 213.194.42.105 | Chrome | 207 | |
3 | 51.52.146.6 | Edge | 7 | |
4 | 42.111.129.57 | Safari | 141 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ID | IP Address: String | ChromeBrowser: Number | FirefoxBrowser: Number | EdgeBrowser: Number | SafariBrowser: Number | Duration: Number | |
---|---|---|---|---|---|---|---|
0 | 86.98.19.228 | 1 | 0 | 0 | 0 | 40 | |
1 | 95.255.60.157 | 0 | 1 | 0 | 0 | 50 | |
2 | 213.194.42.105 | 1 | 0 | 0 | 0 | 207 | |
3 | 51.52.146.6 | 0 | 0 | 1 | 0 | 7 | |
4 | 42.111.129.57 | 0 | 0 | 0 | 1 | 141 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Character one-hot encoding | Embedding or Bucketing | |
---|---|---|
fixed length inputs | variable and long inputs | |
low character cardinality | chracter cardinality is not an issue | |
new values are frequent | best to have visibility of entire population of inputs at design phase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Operation | Keycodes | |
---|---|---|
Start a screen session | `screen -a` | |
Detach from current screen session | `Ctrl + Shift + D A` | |
Reattach to a recent detached session | `screen -r` | |
List of screens | `screen -ls` | |
Attach to screen with name | `screen -xS name` | |
Name a screen | `Ctrl+a :sessionname name Enter` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credits: https://stackoverflow.com/a/52127761/1585523 | |
import tensorflow as tf | |
from tensorflow.keras import backend as K | |
# Define the custom accuracy tensorflow metric | |
def three_class_acc(y_true, y_pred): | |
tr = tf.floor(tf.to_float(K.argmax(y_true, axis=-1) / 3)) | |
pr = tf.floor(tf.to_float(K.argmax(y_pred, axis=-1) / 3)) | |
return K.cast(K.equal(tr, pr), K.floatx()) |
OlderNewer