{"id":17982212,"url":"https://github.com/kmkolasinski/approxkernel","last_synced_at":"2026-01-31T08:32:27.117Z","repository":{"id":88309052,"uuid":"188649441","full_name":"kmkolasinski/approxkernel","owner":"kmkolasinski","description":"approxkernel","archived":false,"fork":false,"pushed_at":"2020-03-30T19:07:56.000Z","size":1468,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-27T00:18:12.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kmkolasinski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-26T06:46:04.000Z","updated_at":"2020-05-17T07:44:02.000Z","dependencies_parsed_at":"2023-05-19T15:00:42.800Z","dependency_job_id":null,"html_url":"https://github.com/kmkolasinski/approxkernel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kmkolasinski/approxkernel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmkolasinski%2Fapproxkernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmkolasinski%2Fapproxkernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmkolasinski%2Fapproxkernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmkolasinski%2Fapproxkernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kmkolasinski","download_url":"https://codeload.github.com/kmkolasinski/approxkernel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmkolasinski%2Fapproxkernel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28935403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T07:49:44.436Z","status":"ssl_error","status_checked_at":"2026-01-31T07:49:34.274Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T18:13:28.239Z","updated_at":"2026-01-31T08:32:27.101Z","avatar_url":"https://github.com/kmkolasinski.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ApproxKernels\n\n## Non Conda way of installation:\n\n* Install python3.6 and pip3, this can be done via:\n\n```bash\nsudo apt-get install python3.6\nsudo apt install python3-pip\nsudo apt-get install python3.6-tk\n```\n\n* Then install python lib with `install_python_lib.sh`\n\n## Install with conda envrionment\n\n* Using conda enviroments is more safe approach\n* Create or use existing conda envionment. \n* Enable created conda environment e.g. `source activate kernels`\n* Enter python_lib folder and run: `pip install .`\n\n\n## Training custom kernel\n\nThis example shows how to train kernel from exising predefined configuration\n\n* Enter `tests/resources/coulomb1d_kernel` folder\n* Check content of config.yml and kernel.py files\n* `config.yml` - contains grid definition, number of scales and training schedule\n* `kernel.py` - contains `def kernel_fn(r: float) -\u003e float:` which contains definition of your kernel function. This function must accept scalar float value and return scalar\nvalue of kernel function. For example f(r) = 1/r. Make sure that there are no singularities.\n* Open terminal in this folder. Make sure you are in correct conda environment.\n* Just in case run: `source activate kernels` \n* Run `fit_kernel` command, wait ...\n* Use the created kernel files in your fortran code:\n\n```fortran\nUSE modutils\nUSE modio\nUSE modapproxkernel2d\n\nINTEGER, PARAMETER :: width = 128, height = 128\nREAL(KIND=8), DIMENSION(width, height) :: input_x, output_x\nREAL(KIND=8), DIMENSION(:, :, :), ALLOCATABLE :: kernels\nTYPE(ApproxDKernel2D) :: kernelOp\n\nCALL read_kernels_2d(\u0026\n    \"path/kernels_1D_scales=4_size=33_grid=128_loss=X.XXXX.txt\", 4, 33, kernels)\nCALL initapproxkernel2d(kernelOp, kernels=kernels, input_shape=[width, height])\nCALL execapproxkernel2d(kernelOp, input_x, output_x)\nCALL deleteapproxkernel2d(kernelOp)\n```\n\n\n## Running fortran examples with multiple threads using MKL threading:\n\n* Set enviromental variable:\n```\nexport MKL_NUM_THREADS=8\nexport OMP_NUM_THREADS=8 \n```\n\n## Profiling code\n\n* Compile main code with C=PROFILE option\n```\ncd src\nmake clean\nmake C=PROFILE\ncd -\n```\n* Compile test with the same option\n```\ncd tests\nmake clean \u0026\u0026 make test_profile C=PROFILE\n./test_profile\nloopprofileviewer.sh loop_prof_1579625645.xml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmkolasinski%2Fapproxkernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkmkolasinski%2Fapproxkernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmkolasinski%2Fapproxkernel/lists"}