Eren5717 commited on
Commit
58bd791
·
1 Parent(s): 1f4e140

dataset updated

Browse files
Files changed (1) hide show
  1. data/dataset.json +12 -0
data/dataset.json CHANGED
@@ -37582,5 +37582,17 @@
37582
  "input": "",
37583
  "output": "<p>Depending on the format that outputs the function <code>decrypt_func</code> it is possible to use <code>h5py</code> for loading the decriypted stream and then use the <code>keras.models.load_model</code> function to load the model, which supports <code>h5py.File</code> object type as input model apart from your mentioned string, path to the saved model.</p>\n\n<pre><code>with open('model.hdf5', 'rb') as f_hdl:\n h5 = decrypt_func(f_hdl.read())\n with h5py.File(h5, 'r') as h5_file:\n model = keras.models.load_model(h5_file)\n</code></pre>\n",
37584
  "system": ""
 
 
 
 
 
 
 
 
 
 
 
 
37585
  }
37586
  ]
 
37582
  "input": "",
37583
  "output": "<p>Depending on the format that outputs the function <code>decrypt_func</code> it is possible to use <code>h5py</code> for loading the decriypted stream and then use the <code>keras.models.load_model</code> function to load the model, which supports <code>h5py.File</code> object type as input model apart from your mentioned string, path to the saved model.</p>\n\n<pre><code>with open('model.hdf5', 'rb') as f_hdl:\n h5 = decrypt_func(f_hdl.read())\n with h5py.File(h5, 'r') as h5_file:\n model = keras.models.load_model(h5_file)\n</code></pre>\n",
37584
  "system": ""
37585
+ },
37586
+ {
37587
+ "instruction": "Extracting the top-k value-indices from a 1-D Tensor",
37588
+ "input": "",
37589
+ "output": "<p>As of pull request <a href=\"https://github.com/torch/torch7/pull/496\" rel=\"noreferrer\">#496</a> Torch now includes a built-in API named <a href=\"https://github.com/torch/torch7/blob/03c04c6/doc/maths.md#torchtopkresval-resind-x-k-dim-dir-sort\" rel=\"noreferrer\"><code>torch.topk</code></a>. Example:</p>\n\n<pre><code>&gt; t = torch.Tensor{9, 1, 8, 2, 7, 3, 6, 4, 5}\n\n-- obtain the 3 smallest elements\n&gt; res = t:topk(3)\n&gt; print(res)\n 1\n 2\n 3\n[torch.DoubleTensor of size 3]\n\n-- you can also get the indices in addition\n&gt; res, ind = t:topk(3)\n&gt; print(ind)\n 2\n 4\n 6\n[torch.LongTensor of size 3]\n\n-- alternatively you can obtain the k largest elements as follow\n-- (see the API documentation for more details)\n&gt; res = t:topk(3, true)\n&gt; print(res)\n 9\n 8\n 7\n[torch.DoubleTensor of size 3]\n</code></pre>\n\n<p>At the time of writing the CPU implementation follows a <a href=\"https://github.com/wickedfoo/torch7/blob/ef019670474b69629a8b3d50eb426d5858bd5c45/lib/TH/generic/THTensorMath.c#L1757-L1769\" rel=\"noreferrer\">sort and narrow approach</a> (there are plans to improve it in the future). That being said an optimized GPU implementation for cutorch is currently being <a href=\"https://github.com/torch/cutorch/pull/296\" rel=\"noreferrer\">reviewed</a>.</p>\n",
37590
+ "system": ""
37591
+ },
37592
+ {
37593
+ "instruction": "itorch creates a python console, not a torch console",
37594
+ "input": "",
37595
+ "output": "<p>iTorch supports iPython v2.3 or above. Please see the required dependencies.\n You seem to have iPython v 0.1.2, maybe that's a reason you see this behavior.</p>\n",
37596
+ "system": ""
37597
  }
37598
  ]