Feed aggregator

Show HN: Efficient `Torch.cdist` Using Triton

Hacker News - 14 hours 30 min ago

For my research, I needed to use `torch.cdist` https://docs.pytorch.org/docs/stable/generated/torch.cdist.h... with p != 2.

Turns out torch's implementation for cdist with p != 2 is prohibitively slow. I came up with an alternative implementation using triton https://triton-lang.org/, which supports backprop and so can be used for training too.

Should be pretty plug-and-play, if you're using `torch.cdist` too it'd be awesome if you could try it with your code and share feedback for things that break.

Huge shoutout to both torch's and triton's teams for making it easy to write and integrate custom ops, I'm new to this and looking back, the whole process was streamlined very effectively.

Comments URL: https://news.ycombinator.com/item?id=44296817

Points: 1

# Comments: 0

Categories: Hacker News

Show HN: Swagger-mcp-server – expose your OpenAPI APIs to LLMs

Hacker News - 14 hours 30 min ago

We just released an MCP server that exposes Swagger/OpenAPI specs to large language models. It enables LLMs to browse endpoints, understand operations, and call real APIs with structured guidance. Built to be a developer-friendly bridge between your docs and intelligent agents.

Comments URL: https://news.ycombinator.com/item?id=44296814

Points: 2

# Comments: 0

Categories: Hacker News

Show HN: Struggling with complex legacy systems? Learn to rebuild your systems

Hacker News - 14 hours 51 min ago

Free webinar available! Registration is mandatory.

Comments URL: https://news.ycombinator.com/item?id=44296705

Points: 1

# Comments: 0

Categories: Hacker News

Show HN: A video walkthrough of my astrophotography galaxy processing workflow

Hacker News - 14 hours 52 min ago

Hi HN, author here. I've been getting deeper into astrophotography and wanted to document the new software workflow I use to go from a noisy raw stack of images to a clean, detailed final photo of a galaxy.

I find that processing is one of the biggest hurdles in this hobby, and it's a topic where seeing the subtle visual changes is more effective than reading about them, which is why I opted for a video format.

The video covers the following:

The role of calibration frames

Image integration/stacking

"stretching" the image histogram to reveal faint detail

Color calibration and sharpening techniques

The software used is Siril, Photoshop and Seti Astro Suite but could apply to other software. Happy to answer any questions about the process or the equipment used.

Comments URL: https://news.ycombinator.com/item?id=44296703

Points: 1

# Comments: 0

Categories: Hacker News

10-HarmonyOS5-TextProcessingEntity-Case

Hacker News - 15 hours 27 min ago

This article introduces how to use @kit.NaturalLanguageKit in HarmonyOS to extract email addresses from text. By creating a TextProcessingEntity component, users can input text containing email addresses, click a button to extract the email addresses, and finally display the extracted email addresses.

import { EntityType, textProcessing } from '@kit.NaturalLanguageKit';

@Entry @Component struct TextProcessingEntity { @State article: string = '电子邮件(EMAIL):识别文本中的电子邮件地址,如“example@abc.com”'; @State email: string = ''

build() { Column({ space: 20 }) { TextArea({ text: this.article }) .height(200) Text('电子邮箱:' + this.email) Button('提取邮箱') .onClick(async () => { const results = await textProcessing.getEntity(this.article) results.forEach(item => { if (item.type === EntityType.EMAIL) { this.email = item.text } }) }) } .padding(15) .height('100%') .width('100%') } }

Comments URL: https://news.ycombinator.com/item?id=44296507

Points: 1

# Comments: 0

Categories: Hacker News

09-TextProcessing-WordSegment-Case

Hacker News - 15 hours 28 min ago

This article introduces how to use @kit.NaturalLanguageKit in HarmonyOS for text word segmentation and implement a simple sentiment analysis function. By creating a TextProcessingWordSegment component, users can input evaluation text, click a button to perform sentiment analysis, and finally display the sentiment tendency (positive, negative, or neutral) of the evaluation.

import { textProcessing } from '@kit.NaturalLanguageKit';

@Entry @Component struct TextProcessingWordSegment { @State comment: string = 'The logistics is fast, the packaging is good, and I am particularly satisfied with the product'; @State label: string = ''

build() { Column({ space: 20 }) { TextArea({ text: this.comment }) .height(200) Text('Evaluation Nature: ' + this.label) Button('Sentiment Analysis') .onClick(async () => { const results = await textProcessing.getWordSegment(this.comment) const words = results.map(item => item.word) const service = new SentimentAnalysisService() this.label = service.analyze(words) }) } .padding(15) .height('100%') .width('100%') } }

// Sentiment Analysis Service Class class SentimentAnalysisService { private positiveWords = ['good', 'satisfied', 'great', 'excellent', 'fast']; private negativeWords = ['bad', 'slow', 'expensive', 'awful', 'unsatisfied'];

analyze(words: string[]) { let score = 0.5; words.forEach(word => { if (this.positiveWords.includes(word)) { score += 0.1; } if (this.negativeWords.includes(word)) { score -= 0.1; } }); score = Math.max(0, Math.min(1, score)); const label = score > 0.6 ? 'Positive' : score < 0.4 ? 'Negative' : 'Neutral'; return label; } }

Comments URL: https://news.ycombinator.com/item?id=44296502

Points: 1

# Comments: 0

Categories: Hacker News

Pages