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
rom keras import applications | |
from keras import optimizers | |
from keras.models import Sequential, Model | |
from keras.layers import Dropout, Flatten, Dense | |
from keras import backend as k | |
from pprint import pprint as pp | |
img_width, img_height = 300, 300 | |
train_data_dir = "/train" | |
validation_data_dir = "/validation" |
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 keras.optimizers import SGD | |
from keras.applications.vgg16 import VGG16 | |
model = VGG16(weight='imagenet', include_top=True) | |
sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True) | |
model.compile(optimizer=sgd, loss='categorical) |
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 VGG16(weights_path=None): | |
model = Sequential() | |
model.add(ZeroPadding2D((1,1),input_shape=(224,224,3))) | |
model.add(Convolution2D(64, (3, 3), activation='relu', padding='same', name='block1_conv1')) | |
model.add(Convolution2D(64, (3, 3), activation='relu', padding='same', name='block1_conv2')) | |
model.add(MaxPooling2D((2,2), strides=(2,2), name='block1_pool')) | |
model.add(Convolution2D(128, (3, 3), activation='relu', padding='same', name='block2_conv1')) | |
model.add(Convolution2D(128, (3, 3), activation='relu', padding='same', name='block2_conv2')) |
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
require File.expand_path(File.dirname(__FILE__) + "/../sanitize_tinymce_text") | |
include SanitizeTinymceText | |
namespace :html do | |
desc "Limpiar descripciones guarrillas con css inline y spans" | |
task :clean => :environment do | |
Publication.all.each do |pub| | |
pub.abstract = sanitize_text(pub.abstract) | |
pub.save |
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
# Pasos para compilar ImageMagick e instalar RMagick en Debian | |
# Gracias a Ivan Belmonte (@ibelmonte) | |
# | |
# Instalar las dependencias de ImageMagick para poderlo compilar | |
sudo apt-get install libjpeg62-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev libexif-dev perl libjasper-dev libltdl3-dev graphviz gs-gpl pkg-config | |
# Compilar ImageMagick para que se pueda instalar luego RMagick, que requiere la versión 6.3+ y Debian incorpora la 6.2.x. | |
cd /usr/local/src | |
wget -c ftp://ftp.fu-berlin.de/unix/X11/graphics/ImageMagick/ImageMagick-6.4.1-10.tar.gz | |
tar zxvfp ImageMagick-6.4.1-10.tar.gz |