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 | |
from tensorflow.python.compiler.mlcompute import mlcompute | |
mlcompute.set_mlc_device(device_name='gpu') | |
mnist = tf.keras.datasets.mnist | |
(x_train, y_train), (x_test, y_test) = mnist.load_data() |
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
paris = [1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 15] | |
france = [2, 6, 10, 12, 14] | |
def query(posting1, posting2): | |
result = [] | |
it1 = iter(posting1) | |
it2 = iter(posting2) | |
el1 = next(it1) |
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
ncols = 3 | |
nrows = 4 | |
# create a figure of dimension nrows X ncols | |
fig, ax = plt.subplots(nrows=nrows, ncols=ncols, figsize=(20, 15)) | |
# keeps track of the indexes of iaq | |
df_idx_counter = 0 | |
# iterate through the grid and plot one iaq element in each grid box |
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
let storeId = 386 | |
let param = args.widgetParameter | |
if (param != null && param.length > 0) { | |
storeId = param | |
} | |
const storeCapacity = await fetchAmountOfPaper() | |
const storeInfo = await fetchStoreInformation() | |
const widget = new ListWidget() | |
await createWidget() |
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
def merge_sort(arr): | |
if len(arr) > 1: | |
middle = len(arr) // 2 | |
left = arr[:middle] | |
right = arr[middle:] | |
merge_sort(left) | |
merge_sort(right) |
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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
import torch.utils.data as data | |
import skimage | |
import skimage.io | |
import skimage.transform |
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
""" | |
Taken from https://github.com/alexander-rakhlin/CNN-for-Sentence-Classification-in-Keras | |
""" | |
import numpy as np | |
import re | |
import itertools | |
from collections import Counter | |
""" |
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 node:10.11-alpine | |
WORKDIR /usr/app | |
COPY . . | |
RUN npm install | |
EXPOSE $PORT | |
CMD [ "npm", "run", "start" ] |
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
"scripts": { | |
"start": "npm run build && node build/server.js", | |
"build": "npm run clean && npm run babel-build", | |
"clean": "rimraf ./build", | |
"babel-build": "./node_modules/.bin/babel src/ --out-dir build/ --ignore ./node_modules/,./babelrc,./package.json,./package-lock.json,./npm-debug.log --copy-files", | |
"eslint-init": "./node_modules/.bin/eslint --init", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, |
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 express from 'express'; | |
import morgan from 'morgan'; | |
import bodyParser from 'body-parser'; | |
const app = express(); | |
app.use(morgan('combined')); | |
app.use(bodyParser.json()); | |
app.get('/', (req, res) => { |