Compose advanced models with Create ML Components

RSS for tag

Discuss the WWDC22 Session Compose advanced models with Create ML Components

Posts under wwdc2022-10020 tag

3 Posts

Post

Replies

Boosts

Views

Activity

Adding custom Create ML model into Create ML Components pipeline
I have been reading up on the new Create ML Components documentation, mostly the sample code for 'Counting Human Counting human body action repetitions in a live video feed', which can be found here. I currently have a body action classifier model built with UIKit/SwiftUI front-end and a relatively complex back-end, but this solution looks far more clean and is 100% SwiftUI - which is a big plus for me. Based on this sample code and documentation, how would I use my own body action classifier with this sample code? Purely interested and amazed by how lightweight it is and would love to see how a CreateML model could be implemented here.
3
0
1.6k
Mar ’23
FullyConnectedNetworkRegressor activation functions
Hi, I am using FullyConnectedNetworkRegressor to build an ML pipeline. The FullyConnectedNetworkConfiguration allows one to specify hiddenUnitCounts for the hidden layers, but I don't see any way to specify or get the activation function for the hidden layers. Is there a way to specify the activation function for the hidden layers? If not, does anyone know what activation function is used for the hidden layers or how they are determined? Thanks, Tom
2
0
885
Jan ’23
Linear Regression training using CreateML components and multiple iterations
Hello, I am currently stuck on a problem involving the newly released feature of CreateML components. I followed Get to know CreateML components, however, its not clear to me how this model can train with multiple iterations. I got a model to go through one iteration with the code shown in the video (it wasnt released as a project file), but there doesnt seem to be a way to increase the iterations. I also looked through the only associated project on CreateML components, but the code was different from what was described in that video and lacked the audio classifier example to see how it ticked. It was also mentioned in the video that there might be issues saving the model in a CoreML file format due to it being custom, but that leaves the question of how ones supposed to save the trained model once done. It seems like saving a model would be really beneficial to machine learning tasks, right? Here is the code I am using in swift playgrounds: truct ImageRegressor{ static let trainingDataURL = URL(fileURLWithPath: "Project/regression_label") static let parameterURL = URL(fileURLWithPath: "Project/parameters") static func train() async throws -> some Transformer<CIImage, Float>{ let estimator = ImageFeaturePrint() .appending(LinearRegressor()) let data = try AnnotatedFiles(labeledByNamesAt: trainingDataURL, separator: "-",type: .image) .mapFeatures(ImageReader.read) .mapAnnotations({_ in Float()}) let (training,validation) = data.randomSplit(by: 0.8) let transformer = try await estimator.fitted(to:training,validateOn: validation){ event in guard let trainingMaxError = event.metrics[.trainingMaximumError] else{ return } guard let validationMaxError = event.metrics[.validationMaximumError] else{ return } print("Training max error: \(trainingMaxError), Validation max error: \(validationMaxError)") } let validationError = try await meanAbsoluteError( transformer.applied(to: validation.map(\.feature)), validation.map(\.annotation)) print("Mean absolute error: \(validationError)") try estimator.write(transformer, to:parameterURL) return transformer } } func doSomething() { Task{ let transformer = try await ImageRegressor.train() } } doSomething()
0
0
974
Dec ’22
Adding custom Create ML model into Create ML Components pipeline
I have been reading up on the new Create ML Components documentation, mostly the sample code for 'Counting Human Counting human body action repetitions in a live video feed', which can be found here. I currently have a body action classifier model built with UIKit/SwiftUI front-end and a relatively complex back-end, but this solution looks far more clean and is 100% SwiftUI - which is a big plus for me. Based on this sample code and documentation, how would I use my own body action classifier with this sample code? Purely interested and amazed by how lightweight it is and would love to see how a CreateML model could be implemented here.
Replies
3
Boosts
0
Views
1.6k
Activity
Mar ’23
FullyConnectedNetworkRegressor activation functions
Hi, I am using FullyConnectedNetworkRegressor to build an ML pipeline. The FullyConnectedNetworkConfiguration allows one to specify hiddenUnitCounts for the hidden layers, but I don't see any way to specify or get the activation function for the hidden layers. Is there a way to specify the activation function for the hidden layers? If not, does anyone know what activation function is used for the hidden layers or how they are determined? Thanks, Tom
Replies
2
Boosts
0
Views
885
Activity
Jan ’23
Linear Regression training using CreateML components and multiple iterations
Hello, I am currently stuck on a problem involving the newly released feature of CreateML components. I followed Get to know CreateML components, however, its not clear to me how this model can train with multiple iterations. I got a model to go through one iteration with the code shown in the video (it wasnt released as a project file), but there doesnt seem to be a way to increase the iterations. I also looked through the only associated project on CreateML components, but the code was different from what was described in that video and lacked the audio classifier example to see how it ticked. It was also mentioned in the video that there might be issues saving the model in a CoreML file format due to it being custom, but that leaves the question of how ones supposed to save the trained model once done. It seems like saving a model would be really beneficial to machine learning tasks, right? Here is the code I am using in swift playgrounds: truct ImageRegressor{ static let trainingDataURL = URL(fileURLWithPath: "Project/regression_label") static let parameterURL = URL(fileURLWithPath: "Project/parameters") static func train() async throws -> some Transformer<CIImage, Float>{ let estimator = ImageFeaturePrint() .appending(LinearRegressor()) let data = try AnnotatedFiles(labeledByNamesAt: trainingDataURL, separator: "-",type: .image) .mapFeatures(ImageReader.read) .mapAnnotations({_ in Float()}) let (training,validation) = data.randomSplit(by: 0.8) let transformer = try await estimator.fitted(to:training,validateOn: validation){ event in guard let trainingMaxError = event.metrics[.trainingMaximumError] else{ return } guard let validationMaxError = event.metrics[.validationMaximumError] else{ return } print("Training max error: \(trainingMaxError), Validation max error: \(validationMaxError)") } let validationError = try await meanAbsoluteError( transformer.applied(to: validation.map(\.feature)), validation.map(\.annotation)) print("Mean absolute error: \(validationError)") try estimator.write(transformer, to:parameterURL) return transformer } } func doSomething() { Task{ let transformer = try await ImageRegressor.train() } } doSomething()
Replies
0
Boosts
0
Views
974
Activity
Dec ’22