mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-30 23:47:31 +03:00 
			
		
		
		
	Fix parser maxout_pieces=1
This commit is contained in:
		
							parent
							
								
									35af5819e0
								
							
						
					
					
						commit
						fa6d473390
					
				|  | @ -465,6 +465,7 @@ cdef class precompute_hiddens: | ||||||
|         return state_vector, backprop_maxout |         return state_vector, backprop_maxout | ||||||
| 
 | 
 | ||||||
|     def _relu_nonlinearity(self, state_vector): |     def _relu_nonlinearity(self, state_vector): | ||||||
|  |         state_vector = state_vector.reshape((state_vector.shape[0], -1)) | ||||||
|         mask = state_vector >= 0. |         mask = state_vector >= 0. | ||||||
|         state_vector *= mask |         state_vector *= mask | ||||||
|         # We're outputting to CPU, but we need this variable on GPU for the |         # We're outputting to CPU, but we need this variable on GPU for the | ||||||
|  | @ -473,7 +474,6 @@ cdef class precompute_hiddens: | ||||||
| 
 | 
 | ||||||
|         def backprop_relu(d_best): |         def backprop_relu(d_best): | ||||||
|             d_best *= mask |             d_best *= mask | ||||||
|             d_best = d_best.reshape((d_best.shape + (1,))) |             return d_best.reshape((d_best.shape + (1,))) | ||||||
|             return d_best |  | ||||||
|   |   | ||||||
|         return state_vector, backprop_relu |         return state_vector, backprop_relu | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user