Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 CaptionNet(nn.Module): | |
def __init__(self, n_tokens=n_tokens, emb_size=128, lstm_units=256, cnn_feature_size=2048): | |
""" A recurrent 'head' network for image captioning. See scheme above. """ | |
super(self.__class__, self).__init__() | |
# a layer that converts conv features to | |
self.cnn_to_h0 = nn.Linear(cnn_feature_size, lstm_units) | |
self.cnn_to_c0 = nn.Linear(cnn_feature_size, lstm_units) | |
# recurrent part, please create the layers as per scheme above. |
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 sklearn.ensemble import BaggingClassifier | |
def bootstrap_predictions(estimator, X, y, X_test, n_bootstrap=101): | |
"""Bootstrap a given classifier. | |
Parameters | |
---------- | |
estimator : object | |
A classifier instance with sklearn-compatible interface. |
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 nearest_neighbours(X, Y, norm=2.0): | |
"""Index the rows of `Y` in increasing order of distance from each row in `X`. | |
Parameters | |
---------- | |
X : array, 2 dimensional, shape = (n_samples, n_dim) | |
The matrix, for the rows of which to find the closest row in `Y`. | |
Y : array, 2 dimensional, shape = (n_reference, n_dim) | |
The matrix, among the rows of which to seek the closest one for `X`. |
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 numpy as np | |
import scipy as sp | |
from numpy import random | |
from numpy import matlib | |
import matplotlib.pyplot as plt | |
from gurobipy import GRB | |
import gurobipy as grb | |
class Problem: |
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 pandas as pd | |
df = pd.read_excel('D:\\BILL THÁNG 1.xlsx') | |
du = df.ix[:, 4] | |
temp_list = [] | |
for cell in du: | |
try: | |
ed = ''.join(cell.split(',')[-1]) | |
print(ed) | |
temp_list.append(ed) |
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
'use strict'; | |
const apiai = require('apiai'); | |
const config = require('./config'); | |
const express = require('express'); | |
const crypto = require('crypto'); | |
const bodyParser = require('body-parser'); | |
const request = require('request'); | |
const app = express(); | |
const uuid = require('uuid'); |