code stringlengths 3 6.57k |
|---|
Adam(lr=0.0001, decay=0.0) |
model.compile(loss='binary_crossentropy', optimizer=optimizer, metrics=['accuracy']) |
get_scaled_imgs(df_train) |
np.array(df_train['is_iceberg']) |
df_train.inc_angle.replace('na',0) |
np.where(df_train.inc_angle>0) |
get_more_images(Xtrain) |
np.concatenate((Ytrain,Ytrain,Ytrain) |
train_test_split(Xtrain, Ytrain, test_size=0.1) |
get_more_images(X_train) |
np.concatenate([y_train, y_train, y_train]) |
get_more_images(X_valid) |
np.concatenate([y_valid, y_valid, y_valid]) |
getModel() |
model.summary() |
EarlyStopping(monitor='val_loss', patience=10, verbose=0, mode='min') |
ModelCheckpoint(model_file, save_best_only=True, monitor='val_loss', mode='min') |
ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=5, verbose=1, epsilon=1e-6, mode='min') |
model.fit(Xtr_more, Ytr_more, batch_size=batch_size, epochs=50, verbose=1, callbacks=[earlyStopping, mcp_save, reduce_lr_loss], validation_split=0.25) |
model.fit(Xtr_more, Ytr_more, batch_size=batch_size, epochs=60, verbose=1, callbacks=[mcp_save, reduce_lr_loss], validation_split=0.2) |
model.load_weights(filepath = model_file) |
model.evaluate(Xtrain, Ytrain, verbose=1) |
print('Train score:', score[0]) |
print('Train accuracy:', score[1]) |
pd.read_json('./input/test.json') |
df_test.inc_angle.replace('na',0) |
get_scaled_imgs(df_test) |
model.predict(Xtest) |
pd.DataFrame({'id': df_test["id"], 'is_iceberg': pred_test.reshape((pred_test.shape[0]) |
print(submission.head(10) |
submission.to_csv('sub-2bands-nodrop-aug.csv', index=False) |
naehere_pi_an(n) |
range(n) |
futures.ThreadPoolExecutor(max_workers=4) |
print(list(ex.map(naehere_pi_an, N) |
nicovideo_login(user, password) |
request.urlopen(request.Request("https://secure.nicovideo.jp/secure/login?site=niconico", headers=fake_headers, data=data.encode('utf-8') |
nicovideo_download(url, output_dir='.', merge=True, info_only=False) |
ssl.SSLContext(ssl.PROTOCOL_TLSv1) |
request.HTTPCookieProcessor() |
request.build_opener(ssl_context, cookie_handler) |
request.install_opener(opener) |
netrc.netrc() |
authenticators('nicovideo') |
input("User: ") |
getpass.getpass("Password: ") |
print("Logging in...") |
nicovideo_login(user, password) |
get_html(url) |
unicodize(r1(r'<span class="videoHeaderTitle"[^>]*>([^<]+) |
url.split('/') |
split('?') |
get_html('http://www.nicovideo.jp/api/getflv?v=%s' % vid) |
parse.unquote(r1(r'url=([^&]+) |
url_info(real_url) |
print_info(site_info, title, type, size) |
download_urls([real_url], title, ext, size, output_dir, merge = merge) |
playlist_not_supported('nicovideo') |
TestClassOelintVarsValueQuoted(TestBaseClass) |
pytest.mark.parametrize('id', ['oelint.vars.valuequoted']) |
pytest.mark.parametrize('occurrence', [2]) |
test_bad(self, input, id, occurrence) |
self.check_for_id(self._create_args(input) |
pytest.mark.parametrize('id', ['oelint.vars.valuequoted']) |
pytest.mark.parametrize('occurrence', [0]) |
test_good(self, input, id, occurrence) |
self.check_for_id(self._create_args(input) |
solution(s) |
print( ''.join(reversed(s) |
if( s==''.join(reversed(s) |
bool(True) |
bool(False) |
print('----------start------------') |
print(solution( s ) |
print('------------end------------') |
stringify(cobj, indent=2) |
type(cobj) |
issubclass(type(cobj) |
getattr(cobj, cobj._fields_[0][0]) |
issubclass(type(cobj) |
stringify(getattr(cobj, field[0]) |
bytearray(cobj[:]) |
d (0x%x) |
debugwrap(func) |
caller(*args, **kwargs) |
hasattr(args[0], 'debug') |
print(args[0].__class__.__name__, repr(func) |
repr(args) |
repr(kwargs) |
func(*args, **kwargs) |
VxlBaseException(Exception) |
VxlBaseEvent(object) |
__str__(self) |
stringify(getattr(self.event.tagData, self.tagDataAttr) |
VxlBase(object) |
__init__(self, debug=False, debugapi=False) |
vxlapy.vxlapy(trace=debugapi) |
vxlapy.XLportHandle(vxlapy.XL_INVALID_PORTHANDLE) |
vxlapy.XLaccess(0) |
vxlapy.XLaccess(0) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.