Skip to content

Instantly share code, notes, and snippets.

============================= test session starts ==============================
platform linux -- Python 3.7.9, pytest-5.4.3, py-1.10.0, pluggy-0.13.1 -- /home/notoraptor/anaconda3/envs/myia/bin/python
cachedir: .pytest_cache
rootdir: /media/win/Users/notoraptor/mila/dev/git/myia, inifile: pytest.ini
plugins: cov-2.8.1, timeout-1.4.2
collecting ... collected 1 item
tests/test_grad.py::test_second_order_on_if[python] REPORT/
graph _graph0(%_parameter1) {
%_apply2 = myia.operations.resolve(:tests.test_grad..<f>, g)
import numpy as np
import theano
import theano.tensor as T
import time
x = T.tensor4('x')
x = theano.shared(
np.random.rand(32, 128, 256, 256).astype(theano.config.floatX),
'x')
filters = theano.shared(
@notoraptor
notoraptor / tf_prof_example.md
Created November 29, 2017 19:30
Tensorflow Profiling example

Je crois savoir finalement comment faire du profilage en obtenant la moyenne des temps d'exécution. Il faut utiliser tf.profiler.Profiler.

Comme exemple, j'ai tenté le profilage de l'exemple pour MNIST SOFTMAX fourni par tensorflow: https://github.com/tensorflow/tensorflow/blob/r1.4/tensorflow/examples/tutorials/mnist/mnist_softmax.py

Le code est adapté ci-dessous avec ajout des lignes nécessaires pour le profilage:

# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@notoraptor
notoraptor / test_dnn_float16.py
Last active September 20, 2017 20:09
A script to reproduce a strange error with cudnn conv gradinput in Theano
from __future__ import absolute_import, print_function, division
import sys, math
import numpy as np
import theano
import theano.tests.unittest_tools as utt
from theano.gpuarray.basic_ops import infer_context_name, as_gpuarray_variable, gpu_contiguous, GpuAllocEmpty
from theano.gpuarray.dnn import GpuDnnConvDesc, GpuDnnConvGradI, get_precision
from theano.gpuarray.tests.config import mode_with_gpu, ref_cast
from theano.tensor.nnet.corr import CorrMM_gradInputs
@notoraptor
notoraptor / Bilan des benchmarks pour convnet-benchmarks.md
Last active July 19, 2017 18:17
Bilan des benchmarks pour convnet-benchmarks

J'ai dupliqué le dépôt initial convnet-benchmarks sur mon compte.

Les tests ont été exécutés avec une branche de Theano qui ajoute du code pour afficher des informations en mode DEBUG: Theano/Theano#6166

Les tests ont été exécutés pour les 4 réseaux disponibles (alexnet, googlenet, vgg, overfeat) chaque fois avec les flags Theano suivants:

THEANO_FLAGS=cmodule.debug=True,device=cuda,floatX=float32
# À chaque fois, je change l'algo pour les 3 types de calculs en même temps (fwd, bwd_filter, bwd_data).
# Algos testés: time_once, time_on_shape_change, guess_once, guess_on_shape_change.

Proposition d'un nouveau plan pour la documentation de Windows:

Le plan est fortement calqué sur les docs d'installation pour Ubuntu/MacOS dans theano_dev: http://deeplearning.net/software/theano_versions/dev/install_ubuntu.html :

Requirements:

  • ( même contenu que pour la doc Ubuntu dans cette section: )
    • Préciser que "We only support the installation of the requirements through conda." (comme dans la doc ubuntu).
    • Liste des dépendances requises.
    • Liste des dépendances optionnelles.
  • Requirements installation through conda (recommended)
  • Instructions pour installer la plupart les dépendances via conda.
# coding: utf-8
# In[1]:
import theano
import pymc3 as pm
# get_ipython().magic('matplotlib inline')
import matplotlib.pyplot as plt