code stringlengths 3 6.57k |
|---|
tf.device('/cpu:0') |
merged.append(merge(outputs, mode='concat', concat_axis=0) |
Model(input=model.inputs, output=merged) |
__init__(self) |
get_model(self, parallel=False) |
Sequential() |
model.add(Lambda(lambda x: x / 127.5 - 1., input_shape=(64, 64, 3) |
model.add(Convolution2D(8, 8, 8, subsample=(4, 4) |
model.add(Convolution2D(16, 5, 5, subsample=(2, 2) |
model.add(Convolution2D(32, 5, 5, subsample=(2, 2) |
model.add(Flatten() |
model.add(ELU() |
model.add(Dense(1024, activation='elu') |
model.add(Dropout(.5) |
model.add(ELU() |
model.add(Dense(512, activation='elu') |
model.add(Dropout(.5) |
model.add(Dense(1, name='output') |
model.add(Activation('sigmoid') |
make_parallel(model, 2) |
model.compile(optimizer='sgd', loss='binary_crossentropy', metrics=['accuracy']) |
_model(self) |
Sequential() |
model.add(Convolution2D(8, 3, 3, input_shape=(img_width, img_height, 3) |
model.add(Activation('elu') |
model.add(MaxPooling2D(pool_size=(2, 2) |
model.add(Convolution2D(16, 3, 3) |
model.add(Activation('elu') |
model.add(MaxPooling2D(pool_size=(2, 2) |
model.add(Convolution2D(32, 3, 3) |
model.add(Activation('elu') |
model.add(MaxPooling2D(pool_size=(2, 2) |
model.add(Flatten() |
model.add(Dense(512) |
model.add(Dropout(0.5) |
model.add(Dense(1, activation='sigmoid') |
make_parallel(model, 2) |
compile(self) |
save(self) |
self.model.to_json() |
open("./model.json", "w") |
json.dump(model_json, json_file) |
self.model.save_weights("./model.h5") |
print("Saved model to disk") |
load(self) |
open('./model.json', 'r') |
model_from_json(json.load(jfile) |
self.compile() |
self.model.load_weights('./model.h5') |
get_list(self) |
np.array(glob.glob('training_data/vehicles/*/*') |
np.zeros(vehicles.shape) |
np.array(glob.glob('training_data/non-vehicles/*/*') |
np.zeros(non_vehicles.shape) |
np.concatenate((vehicles, non_vehicles) |
np.concatenate((y_vehicles, y_non_vehicles) |
predict(self, image) |
np.copy(image) |
cv2.resize(img, (64, 64) |
self.model.predict(x, 1) |
train(self, file_list, labels, test_size=0.2, nb_epoch=30, batch_size=128) |
train_test_split(file_list, labels, test_size=test_size, random_state=100) |
build_images(X_test) |
build_images(X_train) |
ImageDataGenerator(rescale=1. / 255) |
train_datagen.flow(train_images, Y_train, batch_size) |
test_datagen.flow(test_images, Y_test, batch_size) |
self.get_model(parallel=False) |
self._model() |
self.compile() |
build_images(x) |
np.zeros((len(x) |
enumerate(x) |
cv2.imread(img_fname) |
cv2.cvtColor(im, cv2.COLOR_BGR2RGB) |
cv2.resize(im, (64, 64) |
do_all(nb_epoch=30, batch_size=256) |
CNNClassifier() |
clf.get_list() |
clf.train(x, y, nb_epoch=nb_epoch, batch_size=batch_size) |
clf.save() |
UniswapV2SpellV1.deploy(bank, werc20, urouter, celo, {'from': admin}) |
cusd.mint(admin, 10000000 * 10**6, {'from': admin}) |
ceur.mint(admin, 10000000 * 10**6, {'from': admin}) |
cusd.approve(urouter, 2**256-1, {'from': admin}) |
ceur.approve(urouter, 2**256-1, {'from': admin}) |
chain.time() |
ufactory.getPair(cusd, ceur) |
print('admin lp bal', interface.IERC20(lp) |
balanceOf(admin) |
UniswapV2Oracle.deploy(core_oracle, {'from': admin}) |
print('ceur Px', simple_oracle.getCELOPx(ceur) |
print('cusd Px', simple_oracle.getCELOPx(cusd) |
core_oracle.setRoute([cusd, ceur, lp], [simple_oracle, simple_oracle, uniswap_lp_oracle]) |
print('lp Px', uniswap_lp_oracle.getCELOPx(lp) |
cusd.mint(alice, 10000000 * 10**6, {'from': admin}) |
ceur.mint(alice, 10000000 * 10**6, {'from': admin}) |
cusd.approve(bank, 2**256-1, {'from': alice}) |
ceur.approve(bank, 2**256-1, {'from': alice}) |
spell.getAndApprovePair(cusd, ceur, {'from': admin}) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.