2016-08-15 2 views
0

지도에서 각 뉴런의 지역을 설정하는 방법을 모르겠습니다. 내가 패턴 입력 (워드) 내 신경 세포 사이의 거리를 계산하는 방법과 동일 하나 개 이상 단어가있는 경우MFCC 기능이있는 kohonen 네트워크를 사용한 음성 인식. 뉴런과 그 무게 사이의 거리를 어떻게 설정합니까?

typedef struct _neuron 
{ 
    mfcc_frame *frames; 
    char *name; 
    double *weights; 
    int num_weights; 
    int x; 
    int y; 
} neuron; 
typedef struct _map 
{ 
neuron *lattice; 
    int latice_size; 
    double mapRadius; 
    int sideX, sideY; 
    int scale; 
} map; 

: 이것은 신경 세포와 맵입니다.

무게에 대해서는 확실하지 않습니다. 나는 단어의 mfcc 특징 량으로 가중치를 정의하지만, 훈련에서 나는 뉴런 사이의 거리에 따라이 가중치를 업데이트해야합니다. 나는 뉴런 사이의 유클리드 거리를 사용하고 있습니다. 그러나 의심의 여지가 가중치를 업데이 트하는 방법입니다. 다음은 초기화지도의 코드와 신경

void init_neuron(neuron *n, int x, int y, mfcc_frame *mfcc_frames, unsigned int n_frames, char *name){ 

double r; 
register int i, j; 
n->frames = mfcc_frames; 
n->num_weights = n_frames; 
n->x = x; 
n->y = y; 

n->name = malloc (strlen(name) * sizeof(char)); 
strcpy(n->name, name); 
n->weights= malloc (n_frames * sizeof (double)); 

for(i = 0; i < n_frames; i++) 
    for(j = 0; j < N_MFCC; j++) 
     n->weights[i] = mfcc_frames[i].features[j]; 

printf("%s lattice %d, %d\n", n->name, n->x, n->y); 

}

초기화지도 :

map* init_map(int sideX, int sideY, int scale){ 
register int i, x, y; 
char *name = NULL; 
void **word_adresses; 
unsigned int n = 0, count = 0; 
int aux = 0; 
word *words = malloc(sizeof(word)); 

map *_map = malloc(sizeof(map)); 
_map->latice_size = sideX * sideY; 
_map->sideX  = sideX; 
_map->sideY  = sideY; 
_map->scale  = scale; 
_map->lattice  = malloc(_map->latice_size * sizeof(neuron)); 
mt_seed(); 

if ((n = get_list(words))){ 
    word_adresses = malloc(n * sizeof(void *)); 
    while (words != NULL){ 
     x = mt_rand() %sideX; 
     y = mt_rand() %sideY; 
     printf("y : %d x: %d\n", y, x); 
     init_neuron(_map->lattice + y * sideX + x, x, y, words->frames, words->n, words->name); 

     word_adresses[count++] = words;  
     words = words->next; 
    } 
    for (i = 0; i < count; i++) 
     free(word_adresses[i]); 
    free(word_adresses); 
    aux++; 
} 

return _map; 

}는 코호 넨 SOM에서

+0

죄송합니다. 귀하가 무엇을 요구하고 있는지 분명하지 않습니다. 질문을 더 잘 설명해주십시오. –

답변

0

, 가중치가되도록 기능 공간에 각각의 뉴런이 하나의 프로토 타입 벡터를 포함한다는 것을 의미합니다. 입력이 12 MFCC이면 각 입력은 12 개의 이중 값 벡터처럼 보일 수 있습니다. 따라서 각 뉴런에는 MFCC에 대해 하나씩 12 개의 값이 있습니다. 입력이 주어지면 가장 일치하는 단위를 찾은 다음 해당 뉴런에 대한 12 개의 코드북 값을 학습률을 기반으로 한 소량의 입력 벡터쪽으로 이동합니다.