This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Before, with Sprockets: | |
| //= require style | |
| //= require tablesort | |
| //= require tooltipster | |
| //= require jquery-ui | |
| // ... | |
| @import 'variables'; | |
| @import 'overall'; | |
| @import 'type'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| ... | |
| output: { | |
| path: outputPath, | |
| publicPath: "https://cnd.com/production/js/", // hostname needs to match Rails config | |
| filename: '[name]-[chunkhash].js' | |
| }, | |
| plugins: [ | |
| new AssetsPlugin({ path: outputPath }), | |
| new webpack.optimize.UglifyJsPlugin(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Python wrappers around Brain. | |
| This file is MACHINE GENERATED! Do not edit. | |
| """ | |
| from google.protobuf import text_format | |
| from tensorflow.core.framework import op_def_pb2 | |
| from tensorflow.python.framework import op_def_registry | |
| from tensorflow.python.framework import ops |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # example input: | |
| sentence = 'The quick brown fox jumped over the lazy dog.' | |
| # tokenize and normalize words, building the set of all vocabulary ever seen | |
| words_set = {} | |
| def tokenize(sentence): | |
| return map(str.lower, sentence[0:-1].split(' ')) | |
| for word in tokenize(sentence): | |
| words_set[word] = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (words, counts, words_per_epoch, self._epoch, self._words, examples, labels) = word2vec.skipgram(filename=opts.train_data, | |
| batch_size=opts.batch_size, | |
| window_size=opts.window_size, | |
| min_count=opts.min_count, | |
| subsample=opts.subsample) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| REGISTER_OP(“Skipgram”) | |
| .Output(“vocab_word: string”) | |
| .Output(“vocab_freq: int32”) | |
| .Output(“words_per_epoch: int64”) | |
| .Output(“current_epoch: int32”) | |
| .Output(“total_words_processed: int64”) | |
| .Output(“examples: int32”) | |
| .Output(“labels: int32”) | |
| .Attr(“filename: string”) | |
| .Attr(“batch_size: int”) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lr = opts.learning_rate * tf.maximum(0.0001, 1.0 — tf.cast(self._words, tf.float32) / words_to_train) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| node { | |
| name: "Cast_1" | |
| op: "Cast" | |
| input: "Skipgram:4" | |
| attr { | |
| key: "DstT" | |
| value { | |
| type: DT_FLOAT | |
| } | |
| } |