This file contains hidden or 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
| const sqlite3 = require("sqlite3") | |
| class SqliteDF { | |
| table: any; | |
| created: boolean; | |
| con: any; | |
| max_index: number; | |
| _group_cols: any; | |
| verbose: boolean; | |
| _cache: any; |
This file contains hidden or 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
| console.error(e); | |
| let { message } = e; | |
| if (e.sqlMessage) { | |
| message = e.sqlMessage.split(" for")[0]; | |
| } | |
| throw new Error(message); |
This file contains hidden or 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
| async function mergeSort<T>(arr: T[]): Promise<T[]> { | |
| if (arr.length < 2) { | |
| return arr; | |
| } | |
| const middle = Math.floor(arr.length / 2); | |
| const left = arr.slice(0, middle); | |
| const right = arr.slice(middle); | |
| const leftPromise = mergeSort(left); |
This file contains hidden or 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
| /* | |
| * The MIT License | |
| * | |
| * Copyright (c) 2010 Mike de Boer | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Mocha All", | |
| "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | |
| "args": [ | |
| "--timeout", |
This file contains hidden or 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
| SHELL=/bin/bash | |
| VW=vw | |
| python_exe=python2.7 | |
| train_data=wsj_train_subset | |
| test_data=wsj_test_subset | |
| tag=tags | |
| .SECONDARY: |
This file contains hidden or 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
Show hidden characters
| { | |
| "defaultSeverity": "error", | |
| "extends": [ | |
| "tslint:all" | |
| ], | |
| "jsRules": {}, | |
| "rules": { | |
| "array-type": false, | |
| "comment-format": false, | |
| "forin": false, |
This file contains hidden or 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
| class FullScoreReturn { | |
| constructor( | |
| public readonly log_prob: number, | |
| public readonly ngram_length: number, | |
| public readonly oov: number, | |
| ) { } | |
| get prob() { | |
| return this.log_prob; | |
| } |
This file contains hidden or 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
| import tensorflow as tf | |
| import numpy as np | |
| import keras | |
| import keras.backend as K | |
| from functools import reduce | |
| from keras.models import Model | |
| import keras.callbacks as cbks | |
| from keras.applications import ResNet50 | |
| from keras.layers import Conv2D | |
| import threading |
This file contains hidden or 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
| from keras.layers.core import Layer | |
| from keras import initializers, regularizers, constraints | |
| from keras import backend as K | |
| class Attention(Layer): | |
| def __init__(self, | |
| kernel_regularizer=None, bias_regularizer=None, | |
| kernel_constraint=None, bias_constraint=None, | |
| use_bias=True, **kwargs): | |
| """ |