Skip to content

Instantly share code, notes, and snippets.

@jyegerlehner
jyegerlehner / cifar10_full_solver_lr1_prelu.prototxt
Last active October 15, 2015 20:44
caffe cifar10 example modified for PReLU
# reduce learning rate after 120 epochs (60000 iters) by factor 0f 10
# then another factor of 10 after 10 more epochs (5000 iters)
# The train/test net protocol buffer definition
net: "examples/cifar10/cifar10_full_train_test_prelu.prototxt"
# test_iter specifies how many forward passes the test should carry out.
# In the case of CIFAR10, we have test batch size 100 and 100 test iterations,
# covering the full 10,000 testing images.
test_iter: 100
# Carry out testing every 1000 training iterations.
@matpalm
matpalm / theano_word_embeddings.py
Created May 6, 2015 02:12
trivial word embeddings eg
#!/usr/bin/env python
# see http://matpalm.com/blog/2015/03/28/theano_word_embeddings/
import theano
import theano.tensor as T
import numpy as np
import random
E = np.asarray(np.random.randn(6, 2), dtype='float32')
t_E = theano.shared(E)
t_idxs = T.ivector()
@miohtama
miohtama / sanitycheck.py
Created June 4, 2015 21:22
Perform database sync sanity check to SQLAlchemy models on application startup
import logging
from sqlalchemy import inspect
from sqlalchemy.ext.declarative.clsregistry import _ModuleMarker
from sqlalchemy.orm import RelationshipProperty
logger = logging.getLogger(__name__)
def is_sane_database(Base, session):
@betamax
betamax / generate-docs.sh
Created June 19, 2015 10:53
A script that we use at Lateral to generate our documentation
#!/bin/sh
# Which md files to compile
declare -a arr=("hybrid-recommender" "text-matching" "pre-populated-recommenders")
# Now loop through the above array
for i in "${arr[@]}"
do
# Where to store the documentation
@akirill0v
akirill0v / post1.md
Last active April 8, 2016 08:12
Vexor Post 1

Тестирование программного обеспечения в наши дни стало неотъемлемой частью процесса разработки программного обеспечения во всем мире. Уже не найти ни одного серьезного проекта без покрытия, хотя-бы Unit-тестами. Существуют различные техники и подходы к тестированию. Кто-то покрывает тестами уже написанный код, кто-то использует тестирование как инструмент для добавления новой функциональности (разработка через тестирование). В обоих случаях время, затраченное на тестирование кода, включается в общие затраты по разработке. И чем больше и сложнее проект, тем большее время тратится для выполнения всех тестов. Как оптимизировать затраты на тестирование? Существует несколько путей оптимизации процесса тестирования продукта. От рефакторинга тестов и тестовых данных, до увеличения мощностей оборудования. Рефакторинг и оптимизированный запуск разных групп тестовых заданий действительно может сократить время общего прогона тестов, но в конечном итоге встает вопрос вертикального масштабирования, если ресурсов не хватае

Sparse tensors for Torch7

All types torch.DoubleTensor, torch.FloatTensor, etc. should have their sparse variants: torch.SparseDoubleTensor, torch.SparseFloatTensor, etc.

Copying between dense and sparse matrix should be done with :copy() function.

Underlying BLAS has to be swappable with MKL/OpenBLAS/Atlas, etc. Other math operations have to implemented with CSPARSE.

@SNagappan
SNagappan / README.md
Last active January 8, 2021 15:43
bAbI

##Model

This is an implementation of Facebook's baseline GRU/LSTM model on the bAbI dataset Weston et al. 2015. It includes an interactive demo.

The bAbI dataset contains 20 different question answering tasks.

Model script

The model training script train.py and demo script demo.py are included below.

Instructions

Serving Flask under a subpath

Your Flask app object implements the __call__ method, which means it can be called like a regular function. When your WSGI container receives a HTTP request it calls your app with the environ dict and the start_response callable. WSGI is specified in PEP 0333. The two relevant environ variables are:

SCRIPT_NAME
The initial portion of the request URL's "path" that corresponds to the application object, so that the application knows its virtual "location". This may be an empty string, if the application corresponds to the "root" of the server.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anj1
anj1 / subexpr.py
Last active January 20, 2020 22:41
import types
import tensorflow as tf
import numpy as np
# Expressions are represented as lists of lists,
# in lisp style -- the symbol name is the head (first element)
# of the list, and the arguments follow.
# add an expression to an expression list, recursively if necessary.
def add_expr_to_list(exprlist, expr):