0

현재 내 교과 과정을위한 프로그램 분류자를 구현 중입니다. 강사가 "진화하는 ANN"알고리즘을 사용하도록 요청합니다. NEAT (Neuro Evolution of Augmenting Topologies)라는 패키지를 발견했습니다. 필자는 10 개의 입력과 7 개의 출력을 가지고 있으며, 그 문서에서 소스를 수정합니다.여러 출력을 가진 NEAT

def eval_fitness(genomes): 
for g in genomes: 
    net = nn.create_feed_forward_phenotype(g) 

    mse = 0 

    for inputs, expected in zip(alldata, label): 
     output = net.serial_activate(inputs) 
     output = np.clip(output, -1, 1) 
     mse += (output - expected) ** 2 

    g.fitness = 1 - (mse/44000) #44000 is the number of samples 
    print(g.fitness) 

구성 파일도 변경되어 프로그램에 입력 10 개와 출력 7 개가 있습니다. 내가 코드를 실행하려고하면 는하지만, 내가 어떻게해야 무엇 나를

Traceback (most recent call last): 
 
    File "/home/ilhammaziz/PycharmProjects/tuproSC2/eANN.py", line 40, in <module> 
 
    pop.run(eval_fitness, 10) 
 
    File "/home/ilhammaziz/.local/lib/python3.5/site-packages/neat/population.py", line 190, in run 
 
    best = max(population) 
 
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

오류 준다? 감사합니다

+0

NEAT를 선택한 특별한 이유가 있습니까? 그리고 진화 ANN 알고리즘에 의한 교수님의 의미는 무엇입니까? 간단한 멀티 레이어 퍼셉트론이이 범주에 속합니까? – Ironluca

+0

실제로 나는 NEAT를 선택하는 이유가 없습니다. '진화하는 ANN'은 신경 진화와 같다고 생각합니다. 청초한 참고 문헌 http://neat-python.readthedocs.io/en/latest/index.html –

답변

0

까지 내가 말한대로 오류는 귀하의 코드에 있지만 라이브러리 자체에 없다고 말할 수 있습니다. 다른 것을 사용하십시오. This one은 나에게 유망 해 보입니다.

관련 문제