Skip to content

Instantly share code, notes, and snippets.

@koshian2
koshian2 / optuna_cifar_keras.py
Created December 7, 2018 16:26
Optuna Keras
import tensorflow as tf
from tensorflow.keras.applications import InceptionV3, VGG16, MobileNet
from tensorflow.keras.layers import GlobalAveragePooling2D, Dense
from tensorflow.keras.models import Model
from tensorflow.keras.callbacks import History, Callback
import tensorflow.keras.backend as K
from tensorflow.contrib.tpu.python.tpu import keras_support
from keras.utils import to_categorical
from keras.datasets import cifar10
@t3easy
t3easy / .gitlab-ci.yml
Last active April 14, 2025 12:30
Build and deploy docker containers with GitLab CI
image: an-image-with-docker-and-docker-compose
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_CERT_PATH: ".docker"
before_script:
- mkdir -p $DOCKER_CERT_PATH
- echo "$DOCKER_CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$DOCKER_CERT" > $DOCKER_CERT_PATH/cert.pem
@eiichi-worker
eiichi-worker / memo_2018-01-24-001.md
Last active April 8, 2020 08:55
データベースの正規化

データベースの正規化

正規化の種類

  • 非正規形
  • 第1~第5正規形
  • ボイスコッド正規形

用語

@akira345
akira345 / rds_log_download.py
Last active April 3, 2020 11:25
Python勉強がてら作成した、RDSのログファイルを一括ダウンロードするスクリプトです。日付ごとにディレクトリを作成して格納します。
# Import the SDK
import boto3
import datetime
import os
rds = boto3.client('rds', region_name='us-east-1')
db_instance_identifier = "mysql-db"
log_base_path = "./log/"
@dlinsley
dlinsley / change_storage_class.py
Last active June 27, 2022 06:25
aws s3 bucket change storage class by object size
import boto3
import argparse
import string
parser = argparse.ArgumentParser('Change storage class of s3 objects')
parser.add_argument('--bucket', dest='myBucket', default='yourBucketName', help='S3 Bucket to search')
parser.add_argument('--from', dest='fromPath', default='', help='s3 path to start search from')
cliArgs = parser.parse_args()
@svmotha
svmotha / createTable.py
Created June 11, 2017 05:36
Check if DynamoDB table already exists and create one if it doesn't
import boto3
class tableCreate(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
# Query client and list_tables to see if table exists or not
def queryCreate(self):
# Instantiate your dynamo client object
client = boto3.client('dynamodb')
@t-ae
t-ae / pixel_shuffler.py
Last active January 23, 2024 02:02
PixelShuffler layer for Keras
"""
The MIT License (MIT)
Copyright (c) 2018 Takehiro Araki.
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
import math
import numpy as np
batchsize = 2
r = 2
out_channels = 3
in_channels = r ** 2 * out_channels
in_height = 3
in_width = 3
out_height = in_height * r
@telegraphic
telegraphic / parse_nvidia_smi.py
Created September 23, 2016 00:37
Parse nvidia-smi from python
"""
Parse output of nvidia-smi into a python dictionary.
This is very basic!
"""
import subprocess
import pprint
sp = subprocess.Popen(['nvidia-smi', '-q'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)