
fann_descale_output 함수는 ANN(신경망) 출력 결과를 스케일링하는 함수입니다. 이 함수의 인수는 다음과 같습니다.
- net: ANN 네트워크 구조
- output: ANN 출력 결과
- scale: 스케일링을 위한 스케일 인수
이 함수를 사용할 때, 인수 net과 output은 반드시 ANN 네트워크 구조와 출력 결과를 입력해야 합니다. scale 인수는 스케일링을 위한 스케일 인수입니다.
예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
c
#include
int main() {
// ANN 네트워크 구조 생성
fann_type *input, *output;
fann_type *scale;
fann *ann = fann_create_standard(3, 2, 2, 1);
fann_set_activation_steepness_hidden(ann, 1.0);
fann_set_activation_steepness_output(ann, 1.0);
fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
// ANN 출력 결과 생성
input = (fann_type*)malloc(2 * sizeof(fann_type));
output = (fann_type*)malloc(1 * sizeof(fann_type));
scale = (fann_type*)malloc(1 * sizeof(fann_type));
// 스케일링을 위한 스케일 인수 설정
scale[0] = 10.0;
// ANN 네트워크 구조에 출력 결과 입력
fann_type *calc_out = fann_run(ann, input);
// ANN 출력 결과 스케일링
fann_descale_output(ann, calc_out, output, scale);
// 스케일링된 출력 결과 출력
printf("스케일링된 출력 결과: %fn", output[0]);
// 메모리 해제
free(input);
free(output);
free(scale);
fann_destroy(ann);
return 0;
}
이 예제에서는 ANN 네트워크 구조를 생성하고 출력 결과를 스케일링하는 방법을 보여줍니다.
2025-06-02 21:37