--------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_3236\2248814937.py in <module> ----> 1 parameters = model(data, ix_to_char, char_to_ix) ~\AppData\Local\Temp\ipykernel_3236\2797311040.py in model(data, ix_to_char, char_to_ix, num_iterations, n_a, dino_names, vocab_size) 50 # Perform one optimization step: Forward-prop -> Backward-prop -> Clip -> Update parameters 51 # Choose a learning rate of 0.01 ---> 52 curr_loss, gradients, a_prev = optimize(X,Y,a_prev,parameters,learning_rate=0.01) 53 54 ### END CODE HERE ### ~\AppData\Local\Temp\ipykernel_3236\4217941322.py in optimize(X, Y, a_prev, parameters, learning_rate) 31 32 # Forward propagate through time (≈1 line) ---> 33 loss, cache = rnn_forward(X,Y,a_prev,parameters) 34 35 # Backpropagate through time (≈1 line) D:\jupyter notebook\05.序列模型\第一周 循环序列模型\编程作业\Dinosaur lsland --Character -level language model\utils.py in rnn_forward(X, Y, a0, parameters, vocab_size) 91 92 # Run one step forward of the RNN ---> 93 a[t], y_hat[t] = rnn_step_forward(parameters, a[t-1], x[t]) 94 95 # Update the loss by substracting the cross-entropy term of this time-step from it. D:\jupyter notebook\05.序列模型\第一周 循环序列模型\编程作业\Dinosaur lsland --Character -level language model\utils.py in rnn_step_forward(parameters, a_prev, x) 46 47 Waa, Wax, Wya, by, b = parameters['Waa'], parameters['Wax'], parameters['Wya'], parameters['by'], parameters['b'] ---> 48 a_next = np.tanh(np.dot(Wax, x) + np.dot(Waa, a_prev) + b) # hidden state 49 p_t = softmax(np.dot(Wya, a_next) + by) # unnormalized log probabilities for next chars # probabilities for next chars 50 <__array_function__ internals> in dot(*args, **kwargs) ValueError: shapes (50,32) and (30,1) not aligned: 32 (dim 1) != 30 (dim 0)
明明已经改了维度,但还是报错,好像是因为调用的临时python文件,打开任务管理器把后台进程关了。