| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e152782 commit 79eb262
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,44 @@ | |||
| 1 | + using System; | ||
| 2 | + using System.Collections.Generic; | ||
| 3 | + using System.Text; | ||
| 4 | + using Tensorflow; | ||
| 5 | + | ||
| 6 | + namespace TensorFlowNET.Examples | ||
| 7 | + { | ||
| 8 | + /// <summary> | ||
| 9 | + /// Implement Word2Vec algorithm to compute vector representations of words. | ||
| 10 | + /// https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/word2vec.py | ||
| 11 | + /// </summary> | ||
| 12 | + public class Word2Vec : Python, IExample | ||
| 13 | + { | ||
| 14 | + public int Priority => 12; | ||
| 15 | + public bool Enabled { get; set; } = true; | ||
| 16 | + public string Name => "Word2Vec"; | ||
| 17 | + | ||
| 18 | + // Training Parameters | ||
| 19 | + float learning_rate = 0.1f; | ||
| 20 | + int batch_size = 128; | ||
| 21 | + int num_steps = 3000000; | ||
| 22 | + int display_step = 10000; | ||
| 23 | + int eval_step = 200000; | ||
| 24 | + | ||
| 25 | + // Evaluation Parameters | ||
| 26 | + string[] eval_words = new string[] { "five", "of", "going", "hardware", "american", "britain" }; | ||
| 27 | + | ||
| 28 | + public bool Run() | ||
| 29 | + { | ||
| 30 | + PrepareData(); | ||
| 31 | + | ||
| 32 | + var graph = tf.Graph().as_default(); | ||
| 33 | + | ||
| 34 | + tf.train.import_meta_graph("graph/word2vec.meta"); | ||
| 35 | + | ||
| 36 | + return false; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public void PrepareData() | ||
| 40 | + { | ||
| 41 | + var url = ""; | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments