MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / stack_inputs

Function stack_inputs

nlp_class3/memory_network.py:142–150  ·  view source on GitHub ↗
(inputs, story_maxsents, story_maxlen)

Source from the content-addressed store, hash-verified

140# append an array of zeros of size:
141# (max_sentences - num sentences in story, max words in sentence)
142def stack_inputs(inputs, story_maxsents, story_maxlen):
143 for i, story in enumerate(inputs):
144 inputs[i] = np.concatenate(
145 [
146 story,
147 np.zeros((story_maxsents - story.shape[0], story_maxlen), 'int')
148 ]
149 )
150 return np.stack(inputs)
151
152
153

Callers 1

get_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected