Skip to content

Instantly share code, notes, and snippets.

@alisianoi
Created December 12, 2014 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alisianoi/3803231ac551ef5c62a5 to your computer and use it in GitHub Desktop.
Save alisianoi/3803231ac551ef5c62a5 to your computer and use it in GitHub Desktop.
{
"metadata": {
"name": "",
"signature": "sha256:7750b2eb7b054fc6cbeb21c873cd20c8b6eb7792f87694edf5fa4cba146c20ab"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"from random import shuffle, seed\n",
"from itertools import product"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"seed(1535)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"dimensions = [\"x = 2\", \"x = 3\"]\n",
"local_opt_method = [\"(sub)gradient\", \"stohastic (sub)gradient\"]\n",
"global_opt_method = [\"fixed grid\", \"uniform random\"]\n",
"metric = [\"l1\", \"l2\"]\n",
"\n",
"shuffle(dimensions), shuffle(local_opt_method), shuffle(global_opt_method), shuffle(metric)\n",
"\n",
"data = [dimensions, local_opt_method, global_opt_method, metric]\n",
"shuffle(data)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"for combo in product(*data):\n",
" print(combo)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"('x = 3', 'l2', '(sub)gradient', 'fixed grid')\n",
"('x = 3', 'l2', '(sub)gradient', 'uniform random')\n",
"('x = 3', 'l2', 'stohastic (sub)gradient', 'fixed grid')\n",
"('x = 3', 'l2', 'stohastic (sub)gradient', 'uniform random')\n",
"('x = 3', 'l1', '(sub)gradient', 'fixed grid')\n",
"('x = 3', 'l1', '(sub)gradient', 'uniform random')\n",
"('x = 3', 'l1', 'stohastic (sub)gradient', 'fixed grid')\n",
"('x = 3', 'l1', 'stohastic (sub)gradient', 'uniform random')\n",
"('x = 2', 'l2', '(sub)gradient', 'fixed grid')\n",
"('x = 2', 'l2', '(sub)gradient', 'uniform random')\n",
"('x = 2', 'l2', 'stohastic (sub)gradient', 'fixed grid')\n",
"('x = 2', 'l2', 'stohastic (sub)gradient', 'uniform random')\n",
"('x = 2', 'l1', '(sub)gradient', 'fixed grid')\n",
"('x = 2', 'l1', '(sub)gradient', 'uniform random')\n",
"('x = 2', 'l1', 'stohastic (sub)gradient', 'fixed grid')\n",
"('x = 2', 'l1', 'stohastic (sub)gradient', 'uniform random')\n"
]
}
],
"prompt_number": 7
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment